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
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: 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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 06:01:29 2024 UTC