php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #461 Date returns wrong d/m/y
Submitted: 1998-06-15 11:23 UTC Modified: 1998-06-15 11:32 UTC
From: louis at sitebysite dot nl Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0 Final Release OS: Linux 2.0
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: louis at sitebysite dot nl
New email:
PHP Version: OS:

 

 [1998-06-15 11:23 UTC] louis at sitebysite dot nl
The script below outputs 25 October twice, and then has
all following days 1 day off. It's fine if you offset the start-time 
by at least an hour.

   $date=909180000;
   echo "<br>$date: ".Date("d/m/Y", $date);
   $date+=3600*24; 
   echo "<br>$date: ".Date("d/m/Y", $date);
   $date+=3600*24; 
   echo "<br>$date: ".Date("d/m/Y", $date);
   $date+=3600*24;
   echo "<br>$date: ".Date("d/m/Y", $date);

Output:

909180000: 24/10/1998
909266400: 25/10/1998
909352800: 25/10/1998
909439200: 26/10/1998 

or, with offset +3600:

909183600: 24/10/1998
909270000: 25/10/1998
909356400: 26/10/1998
909442800: 27/10/1998 

PHP 3.0 final compiled with --with-system-regex --with-mysql --with-pgsql
using Apache 1.2.6; PHP 2.0b12 also used.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-06-15 11:32 UTC] rasmus
This is not a bug.  This is correct behaviour for your timezone (which I assume is Central Europe Time).  Look at the date, then check when the switch from standard time to
daylight savings time is.  Then marvel at the coincidence that you managed to hit that date and time perfectly!  ;)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 04 17:01:33 2024 UTC