Re: [PHP-DB] Erroneous date and time

2004-06-16 Thread Jason Wong
On Wednesday 16 June 2004 03:36, Philip Thompson wrote:

 Maybe there's something I'm doing incorrectly, but I cannot get the
 date() function to return the appropriate time. It's always 12 hours
 off. I've tried using 24-hour time and 12-hour time (with AM/PM), but
 they both give the wrong time. I even emailed the server admin to make
 sure that the server clock was set correctly, and he said that it was.
 I don't know... Here's my PHP:

 $problemDateTime = date(Y-m-d g:i:s A);
 which returns: 2004-06-13 11:24:21 PM

 To the untrained eye ;), that might appear correct. But that was
 actually submitted at 11:24 AM, not PM. So, that's my code. Any
 suggestions??

Try gmdate() and see whether that gives the expected result.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
You know it's going to be a bad day when you want to put on the clothes
you wore home from the party and there aren't any.
*/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Erroneous date and time

2004-06-15 Thread Philip Thompson
Hi all.
Maybe there's something I'm doing incorrectly, but I cannot get the 
date() function to return the appropriate time. It's always 12 hours 
off. I've tried using 24-hour time and 12-hour time (with AM/PM), but 
they both give the wrong time. I even emailed the server admin to make 
sure that the server clock was set correctly, and he said that it was. 
I don't know... Here's my PHP:

$problemDateTime = date(Y-m-d g:i:s A);
which returns: 2004-06-13 11:24:21 PM
To the untrained eye ;), that might appear correct. But that was 
actually submitted at 11:24 AM, not PM. So, that's my code. Any 
suggestions??

Thanks a bunch,
~Philip
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php