|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-02-08 20:40 UTC] greg at pswdb dot com
Description: ------------ --- From manual page: http://www.php.net/function.date --- $d="2010-01-31 09:06:09"; $i= strtotime($d); echo '<br>' . $d ; echo '<br>' . date("Y-m-d h:m:s",$i); produces this: 2010-01-31 09:06:09 2010-01-31 09:01:09 $d="2011-01-20 09:48:00"; $i= strtotime($d); echo '<br>' . $d ; echo '<br>' . date("Y-m-d h:m:s",$i); produces this: 2011-01-20 09:48:00 2011-01-20 09:01:00 $d="2010-06-26 01:29:39"; $i= strtotime($d); echo '<br>' . $d ; echo '<br>' . date("Y-m-d h:m:s",$i); produces this: 2010-06-26 01:29:39 2010-06-26 01:06:39 Expected result: ---------------- 2010-01-31 09:06:09 2010-01-31 09:06:09 2011-01-20 09:48:00 2011-01-20 09:48:00 2010-06-26 01:29:39 2010-06-26 01:29:39 Actual result: -------------- 2010-01-31 09:06:09 2010-01-31 09:01:09 2011-01-20 09:48:00 2011-01-20 09:01:00 2010-06-26 01:29:39 2010-06-26 01:06:39 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 07 22:00:01 2025 UTC |
echo '<br>' . date("h:m:s a"); produces 02:02:26 pm and (4 sec. later) my interactive fedora 14 command $ date produced Tue Feb 8 14:58:30 EST 2011 which is correct: It is 58 minutes after the hour, not 2 right now. ... therefor, it is the date function in PHP, not linux, and it is not the strtotime function. this time, it was not involved.