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
 [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: Fri Apr 26 18:01:31 2024 UTC