<?php $tests[] = '0000-01-28 00:00:00 UTC'; $tests[] = '0000-01-29 00:00:00 UTC'; $tests[] = '0000-01-30 00:00:00 UTC'; $tests[] = '0000-01-31 00:00:00 UTC'; $tests[] = '0000-02-01 00:00:00 UTC'; $tests[] = '0000-02-27 00:00:00 UTC'; $tests[] = '0000-02-28 00:00:00 UTC'; $tests[] = '0000-02-29 00:00:00 UTC'; $tests[] = '0000-02-30 00:00:00 UTC'; // intentionally invalid day, should be the same as the next. $tests[] = '0000-03-01 00:00:00 UTC'; $tests[] = '0000-03-02 00:00:00 UTC'; foreach ($tests as $test) { $timestamp1 = strtotime($test); $date_time = new DateTime('@' . $timestamp1); $timestamp2 = $date_time->getTimestamp(); print $timestamp1 . "\n"; print $timestamp2 . "\n"; if ($timestamp1 != $timestamp2) { print "timestamps are not equal\n"; } print_r($date_time); print "\n"; }
You have javascript disabled. You will not be able to edit any code.
This script was stopped while abusing our resources