|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-10-05 21:53 UTC] stas@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 22:00:01 2025 UTC |
mktime() should return 86400 (the number of seconds in a day) for the following calculations. For some years (1972, 1978, 1989, 1995, 2000, etc.) it returns 90000 instead of 86400. The following code will demonstrate this. <?php function mktime_test () { for ($i = 0; $i < 100; ++$i) { /* $timestamp should = 86400. (ie: 60 x 60 x 24). */ $timestamp = mktime (0,0,0,10,30,$i) - mktime (0,0,0,10,29,$i); if ($i < 10) { $year = "200" . $i; } else if ($i < 70) { $year = "20" . $i; } else { $year = "19" . $i; } printf (" $year - $timestamp<br> "); } } mktime_test (); ?>