php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55657 Adding a day to the timestamp does not change the value of date('d',$ts)
Submitted: 2011-09-09 18:26 UTC Modified: 2011-09-09 20:01 UTC
From: steve7642 at gmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: Irrelevant OS: Linux linuxvps1.ciniva.com 2.6.1
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: steve7642 at gmail dot com
New email:
PHP Version: OS:

 

 [2011-09-09 18:26 UTC] steve7642 at gmail dot com
Description:
------------
Adding  7 days to the timestamp for 2011-11-05 increased the date by 6 days only. run sample code. 

 

Test script:
---------------
/*
It appears that the day function of the time stamp is falling behind . 
*/ 
 	$ts = mktime(0,0,0,10,29,2011) + 7*86400 ;
	$mday1 = date('d',$ts);  //OK

	$ts = mktime(0,0,0,10,29,2011) + 14*86400 ;
	$mday2 = date('d',$ts); //1 day behind
	
	$ts = mktime(0,0,0,10,29,2011) + 21*86400 ;
	$mday3 = date('d',$ts); // 1 day behind

echo $mday1. ' ' . $mday2.' '. $mday3 ; 



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-09-09 20:01 UTC] dtajchreber@php.net
-Status: Open +Status: Bogus
 [2011-09-09 20:01 UTC] dtajchreber@php.net
You've discovered daylight saving time! This code helps you understand what 
happens slightly better: http://codepad.org/kBgS1g6W 

[1] http://en.wikipedia.org/wiki/Daylight_saving_time
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 07:01:28 2025 UTC