#46589 [Com]: am/pm issue
| From: | mjharmon at email dot arizona dot edu | Date: | Fri, 27 Mar 2009 00:30:13 +0000 |
| Subject: | #46589 [Com]: am/pm issue | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-135194@lists.php.net to get a copy of this message | ||
ID: 46589
Comment by: mjharmon at email dot arizona dot edu
Reported By: micah_blu at bluprintsmedia dot net
Status: No Feedback
Bug Type: Date/time related
Operating System: Linux
PHP Version: 5.2.6
New Comment:
Update. New results:
mjharmon@mx ~ $ date
Thu Mar 26 17:25:16 MST 2009
mjharmon@mx ~ $ php timetest.php
2009-03-26 05:03:19 MST GMT-0700 US/Arizona
Thu, 26 Mar 2009 17:25:19 -0700
<?php
print date('Y-m-d h:m:s T \G\M\TO e') . "\n";
print date('r');
?>
Apparently, the initial time was GMT (without taking into account the
timezone?) But using the rfc2822 format made the date times match up.
Previous Comments:
------------------------------------------------------------------------
[2009-03-27 00:13:38] mjharmon at email dot arizona dot edu
Correction, date and timezone are correct. Timestamp (as in the time
part) is not correct.
------------------------------------------------------------------------
[2009-03-27 00:11:39] mjharmon at email dot arizona dot edu
mjharmon@mx ~ $ php timetest.php
2009-03-26 05:03:20 MST GMT-0700 US/Arizona
versus:
mjharmon@mx ~ $ date
Thu Mar 26 17:10:34 MST 2009
mjharmon@mx ~ $ cat timetest.php
<?php
print date('Y-m-d h:m:s T \G\M\TO e') . "\n";
?>
Timezone is correct, date is not.
------------------------------------------------------------------------
[2008-11-25 01:00:01] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2008-11-17 09:40:32] jani@php.net
Well, if you run in before noon you'll get am. Check your server time
using 24h format instead of the braindead american am/pm crap.
------------------------------------------------------------------------
[2008-11-17 05:28:48] micah_blu at bluprintsmedia dot net
Description:
------------
date() function returns wrong am/pm, usually always outputs am instead
of pm
Reproduce code:
---------------
echo date("Y-m-d h:i a");
Expected result:
----------------
//outputs:
2008-11-16 9:26 pm
Actual result:
--------------
//outputs:
2008-11-16 9:26 am
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46589&edit=1