|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-02-25 22:42 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 01:00:02 2025 UTC |
Description: ------------ Ok I'm trying to do some calendar work right during this summers time change hour. 3/9/2008 at 2 a.m. I work for a television network and we have to created scheduals for every hour of every day. (This includes 2 am) strtotime or possibly strftime is not handling that 2:00 am hour correctly here is some testing: Reproduce code: --------------- <?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 I've tried setting the TZ to US/CDT that didn't help ($test = putenv("TZ=US/CDT");) Expected result: ---------------- I expect the code to return a formated verson of the date "Mar 9 2008 2:00AM" Actual result: -------------- Sun 03/09/08 03:00 AM I apologize in advance if this is my misuse.