php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2299 date of year problem
Submitted: 1999-09-14 21:59 UTC Modified: 1999-09-15 05:41 UTC
From: gib at galileo dot jpte dot hu Assigned:
Status: Closed Package: Other
PHP Version: 3.0.12 OS: winnt 4sp5
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: gib at galileo dot jpte dot hu
New email:
PHP Version: OS:

 

 [1999-09-14 21:59 UTC] gib at galileo dot jpte dot hu
<?php

$doy = intval(date("z",mktime(0,0,0,9,14,1999)));
$dos = intval(date("d",mktime(0,0,0,1,$doy,1999)));

echo "1999 september 14 is not equal to 1999 september ".$dos."<br>;

?>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-09-15 05:41 UTC] riffraff at cvs dot php dot net
date("z",...) returns day of year zero-based. but day-of-month
passed to mktime() is one-based. that's the thing, that makes
it differ by one day.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 03:01:29 2024 UTC