php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31768 wrong date
Submitted: 2005-01-30 22:53 UTC Modified: 2005-01-30 22:58 UTC
From: df at df-web dot hu Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 4.3.10 OS: Linux
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: df at df-web dot hu
New email:
PHP Version: OS:

 

 [2005-01-30 22:53 UTC] df at df-web dot hu
Description:
------------
When I calculatethe 2005-10-31 date whith the script above, it will write out wrong date! That is valable just for 2005-10-31!!!

Reproduce code:
---------------
<?php
$k1=date("d",(strtotime(2005-10-28)+3*86400));
echo $k1."\n" ;// = 30 but  must be 31
?

Expected result:
----------------
31

Actual result:
--------------
30

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-30 22:58 UTC] derick@php.net
We are happy to tell you that you just discovered Daylight Savings
Time. For more information see:
http://webexhibits.org/daylightsaving/b.html
Instead of using mktime/date consider using gmmktime and gmdate which do
not suffer from DST.

.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 12:01:32 2024 UTC