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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Wed Feb 05 10:01:30 2025 UTC