|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1998-09-13 01:45 UTC] rasmus
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 03:00:01 2025 UTC |
<html> <body> Using extension=calendar.dll in php3.ini...<p> <?php $one = mktime(0,0,0,10,25,1998); // Timestamp for Oct. 25, 1998 at 00:00:00 $done = date("m/d/Y H:i:m",$one); // Date conversion for fun echo "$done<br>\n"; $two = mktime(0,0,0,10,26,1998); // Timestamp for Oct. 26, 1998 at 00:00:00 $dtwo = date("m/d/Y H:i:m",$two); // Date conversion for fun echo "$dtwo<br>\n"; $three = $one+86400; // Add a day's worth of seconds to Oct. 25 echo "Does $two = $three?<br>"; // Still on Oct. 25! $dthree = date("m/d/Y H:i:m",$three); // Date conversion for more fun echo "$dthree<br>\n"; echo "What's the difference? "; echo (int)$three-(int)$two; echo "<p>\n"; $four = $two+86400; //Add a day's worth of seconds to Oct. 26 $dfour = date("m/d/Y H:i:m",$four); echo "$dfour<br>\n"; ?> </body> </html>