note 76153 added to function.date

From: Date: Tue, 03 Jul 2007 11:11:25 +0000
Subject: note 76153 added to function.date
Groups: php.notes 
Request: Send a blank email to php-notes+get-128172@lists.php.net to get a copy of this message
For people who used "z" format... The real range of "z" key format is 0 to 365 (instead of 366) and "z" represent the number of spent days in the year. See this examples : <?php define ("\n" , NL ); print '<pre>'; print '"z" format interpretation:' . NL . NL; print 'On 0 timestamp: "' . date( 'z : Y-m-d' , 0 ) . '"' . NL; //show: On 0 timestamp: "0 : 1970-01-01" print 'On second unix day: "' . date( 'z : Y-m-d' , 3600*24 ) . '"' . NL; //show: On second unix day: "1 : 1970-01-02" print 'On the last day of a leap year: "' . date( 'z : Y-m-d' , mktime( 23, 59, 59, 12, 31, 2000 ) ) . '"' . NL; //show: On the last day of a leap year: "365 : 2000-12-31" print 'On the day after the last day of a leap year: "' . date( 'z : Y-m-d' , mktime( 23, 59, 59, 12, 31+1, 2000 ) ) . '"' . NL; //show: On the day after the last day of a leap year: "0 : 2001-01-01" print '</pre>'; ?> ---- Server IP: 195.26.5.11 Probable Submitter: 85.93.207.16 ---- Manual Page -- http://www.php.net/manual/en/function.date.php Edit -- https://master.php.net/note/edit/76153 Del: integrated -- https://master.php.net/note/delete/76153/integrated Del: useless -- https://master.php.net/note/delete/76153/useless Del: bad code -- https://master.php.net/note/delete/76153/bad+code Del: spam -- https://master.php.net/note/delete/76153/spam Del: non-english -- https://master.php.net/note/delete/76153/non-english Del: in docs -- https://master.php.net/note/delete/76153/in+docs Del: other reasons-- https://master.php.net/note/delete/76153 Reject -- https://master.php.net/note/reject/76153 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#128172) next »