Just meet a very odd time() problem.
Service time is: 'Mon Jan 14 22:47:15 CST 2008', I get this string by executing date in shell.
but php function date('Y-m-d H:i:s') returns '2008-01-15 10:47:15'.
My php version is 4.3.2. Do you have any clue what cause this?
php time function bug, does anyone know how to solve it?
Moderator: General Moderators
-
edwinzhang
- Forum Newbie
- Posts: 2
- Joined: Mon Jan 14, 2008 11:19 pm
- jimthunderbird
- Forum Contributor
- Posts: 147
- Joined: Tue Jul 04, 2006 3:59 am
- Location: San Francisco, CA
Re: php time function bug, does anyone know how to solve it?
The time is the same, just the display format is different. Check http://us.php.net/date for formatting details.
-
edwinzhang
- Forum Newbie
- Posts: 2
- Joined: Mon Jan 14, 2008 11:19 pm
Re: php time function bug, does anyone know how to solve it?
I am pretty sure the time is different, time() returns local time, which means server local time.