Output of date() differs from system time by 25 minutes

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mtaylor
Forum Newbie
Posts: 2
Joined: Sun Jul 13, 2008 5:28 am

Output of date() differs from system time by 25 minutes

Post by mtaylor »

Bit of a strange problem here that I'm hoping someone can help me with:

Code: Select all

# date
Sun Jul 13 06:33:57 EDT 2008
 
 
# php
<?
echo date ('M j Y, H:m:s');
?>
Jul 13 2008, 06:07:55
 
# php
<?
echo date_default_timezone_get();
?>
America/New_York
 
 
The time as reported by the server is the correct one, and it seems that PHP is using the correct timezone, so I'm wondering why the difference?
mtaylor
Forum Newbie
Posts: 2
Joined: Sun Jul 13, 2008 5:28 am

Re: Output of date() differs from system time by 25 minutes

Post by mtaylor »

Hmm something is screwed. I spent a few minutes just refreshing one of my pages which displays the time, watching in increment. It was still showing as 7 minutes past 6, even though that's what it had showed 15 minutes ago. The seconds went up to 59, then back to zero but without the minute value increasing:/ That happened a few times, then the hour value suddenly jumped from 6 to 7, ie:

06:07:58
06:07:59
06:07:00
06:07:01
........
06:07:58
06:07:59
07:07:00
07:07:01
....
07:07:59
07:07:00



I'm using PHP 5.2.5 by the way
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Output of date() differs from system time by 25 minutes

Post by VladSun »

http://bg2.php.net/date
m Numeric representation of a month, with leading zeros 01 through 12
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply