note 37510 modified in function.mktime by danbrown

From: Date: Sun, 20 Jul 2008 03:42:11 +0000
Subject: note 37510 modified in function.mktime by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-142084@lists.php.net to get a copy of this message
With regard to Example 1 and using mktime to correct out-of-range input. It should be noted that mktime will implement day light saving amends. Consider the following: <?php print(date("d/m/Y H:i:s",mktime(0,0,0,3,(27 + 1),2004))); ?> OUTPUT "28/03/2004 02:00:00" <?php print(date("d/m/Y H:i:s",(mktime(0,0,0,3,27,2004) + (((1 * 24) * 60) * 60)))); ?> OUTPUT "28/03/2004 00:00:00" Dependent on your requirements this may or may be desirable --was-- With regard to Example 1 and using mktime to correct out-of-range input. It should be noted that mktime will implement day light saving amends. Consider the following: <? print(date("d/m/Y H:i:s",mktime(0,0,0,3,(27 + 1),2004))); ?> OUTPUT "28/03/2004 02:00:00" <? print(date("d/m/Y H:i:s",(mktime(0,0,0,3,27,2004) + (((1 * 24) * 60) * 60)))); ?> OUTPUT "28/03/2004 00:00:00" Dependent on your requirements this may or may be desirable http://php.net/manual/en/function.mktime.php

« previous php.notes (#142084) next »