DST issues and strtotime or strftime

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
jyoung
Forum Newbie
Posts: 1
Joined: Mon Feb 18, 2008 5:35 pm

DST issues and strtotime or strftime

Post by jyoung »

I'm aware that the time change is occuring in this hour. Why am I getting back 3 instead of 2? Thanks.
Some test lines:
<?php
echo(strftime("%a %m/%d/%y %I:%M %p",(strtotime("3/9/2008 2:00:00 AM"))));
echo " --- ";
echo(strftime("%m/%d/%y %I:%M %p",(strtotime("Mar 9 2008 2:00AM"))));
echo " --- ";
echo(strtotime("-2 days ",strtotime("03/09/08")));
echo " --- ";
echo(strtotime("-2 days ", 1205042400));
echo " --- ";
echo(strtotime("3/9/2008 2:00:00 AM"));
echo " --- ";
echo(strtotime("Mar 9 2008 2:00AM"));
?>

Output:
Sun 03/09/08 03:00 AM --- 03/09/08 03:00 AM --- 1204869600 --- 1204869600 --- 1205049600 --- 1205049600
Post Reply