php date give me the same date for 2 different timestamp -
here code :
<?php $aaa = array( 1224972000, 1224973800, 1224975600, 1224977400, 1224979200, 1224981000, 1224982800, 1224984600, 1224986400, 1224988200, 1224990000, 1224991800, 1224993600, 1224995400, 1224997200, ); foreach ($aaa $ts) { $date = \date('m/d/y,h:i:s', $ts); echo "$date \n"; } , result : 10/26/2008,00:00:00 10/26/2008,00:30:00 10/26/2008,01:00:00 10/26/2008,01:30:00 **10/26/2008,02:00:00 10/26/2008,02:30:00 10/26/2008,02:00:00 10/26/2008,02:30:00** 10/26/2008,03:00:00 10/26/2008,03:30:00 10/26/2008,04:00:00 10/26/2008,04:30:00 10/26/2008,05:00:00 10/26/2008,05:30:00 10/26/2008,06:00:00
why ?
i'd imagine in chosen timezone, date switches daylight savings time on day, there 2 2:00ams. see you're studying in liverpool -- on british machine? last sunday in october traditionally shift date between british summer time , greenwich mean time. believe case of europe.
try adding:
date_default_timezone_set("utc");
at start of script; fix timezone 1 without dst adjustments. should find unique results.
Comments
Post a Comment