Page 1 of 1

strtotime problem

Posted: Sat May 20, 2006 5:49 am
by s.dot

Code: Select all

$time = 'May 20 at 6:39 AM';
echo strtotime($time);
echo '<br />';
echo strtotime($time,time());
Both of these give me a timestamp that is exactly two hours behind what it should be. The timestamp returned is at 4:39 AM.

Am I doing something wrong?

Re: strtotime problem

Posted: Sat May 20, 2006 7:51 am
by aerodromoi
scottayy wrote:

Code: Select all

$time = 'May 20 at 6:39 AM';
echo strtotime($time);
echo '<br />';
echo strtotime($time,time());
Both of these give me a timestamp that is exactly two hours behind what it should be. The timestamp returned is at 4:39 AM.

Am I doing something wrong?
Perhaps a timezone issue. What does it say for

Code: Select all

strtotime("now");
?

aerodromoi

Re: strtotime problem

Posted: Mon May 22, 2006 6:26 am
by xpgeek
scottayy wrote:

Code: Select all

$time = 'May 20 at 6:39 AM';
echo strtotime($time);
echo '<br />';
echo strtotime($time,time());
Both of these give me a timestamp that is exactly two hours behind what it should be. The timestamp returned is at 4:39 AM.

Am I doing something wrong?
result of strtotime get in GMT format