|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-10-07 20:52 UTC] spedding at met dot co dot nz
[2001-10-07 21:23 UTC] mfischer@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 19:00:02 2025 UTC |
creating a unix timestamp for a date with zero hours / minutes, and then adding time of day as seconds gives wrong result. snippet from my code ________________________ echo ("\n<!-- before hms ".strftime ("%b %d %Y %H:%M:%S", $dateAndTime)."-->\n"); $dateAndTime += 7200; echo ("\n<!-- before DST ".strftime ("%b %d %Y %H:%M:%S", $dateAndTime)."-->\n"); ________________________ example outputs timestamp before arithmetic <!-- before hms Oct 07 2001 00:00:00--> after adding 7199 (ie 01:59) <!-- before DST Oct 07 2001 01:59:59--> after adding 7200 (ie 02:00) <!-- before DST Oct 07 2001 03:00:00--> only seems to happen for this transition between 1:59 and 2:00 , after that the 1 hour error is consistent.