php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1364 Worrying about DateTime Conversion
Submitted: 1999-04-30 01:56 UTC Modified: 1999-06-20 20:58 UTC
From: holik at kapsch dot net Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0.6 OS: Win32
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: holik at kapsch dot net
New email:
PHP Version: OS:

 

 [1999-04-30 01:56 UTC] holik at kapsch dot net
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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-06-20 20:58 UTC] jim at cvs dot php dot net
mktime() will take another parameter to indicate whether
daylight savings time is in effect in the next release.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 12 14:01:34 2024 UTC