|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1999-06-20 20:58 UTC] jim at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 21 01:00:01 2025 UTC |
My Timezone is GMT +1, Daylight Unix Timestamp is Seconds since 1.1.1970 I want to calculate in Days! One Day has: 60*60*24 Seconds = 86400 Seconds So for calculating in Days I divide the Unix TimeStamp throu 86400 and cut the rest But while programming I found a strange behaviour: $time = gmmktime(1,0,0,4, 30, 1999); // 1 hour if Daylight else 0 hours to get a Unix Timestamp // without a Rest if divide throu 86400 in Days $time2 = mktime(2,0,0,4, 30, 1999); // 1 hour if Daylight else 0 hours + 1 hour GMT +1 for my Timezone // to get a Unix Timestamp // without a Rest if divide throu 86400 in Days echo $time."-".$time2."\n"; echo ($time/86400)."-".($time2/86400)."-".date("YmdHis",$time)."-".date("YmdHis",$time2)."\n"; My Probem is: 1. Why is the Conversion doing such? 2. Not every Country has Daylight, so what can i do if the script should run on a site without daylight May I thest every time my scipt for such hidden bugs? bye Peter.