php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28249 jdtounix and unixtojd conversions 1 day out
Submitted: 2004-05-02 02:07 UTC Modified: 2004-05-02 07:52 UTC
From: ignatius at act28 dot com Assigned:
Status: Not a bug Package: Calendar related
PHP Version: 4.3.6 OS: WinXP/Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
34 - 13 = ?
Subscribe to this entry?

 
 [2004-05-02 02:07 UTC] ignatius at act28 dot com
Description:
------------
jdtounix and unixtojd conversions are 1 day out when timezones are in effect. Specifically, when timezone is negative GMT.

This is happening on both WinXP and Linux for PHP4.3.4 and 4.3.6.

On Windows, it's even more weird. time() returns the 1 May 2004 not 2 May 2004. 


Reproduce code:
---------------
See test script at http://dev.worlddo.com/jdtime.php

Expected result:
----------------
Test script produces both expected and actual results for comparison


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-02 05:19 UTC] ignatius at act28 dot com
On the dev.worlddo.com script, try anything -GMT, e.g. America/Denver or even Atlantic/Cape Verde. You'll see that the strftime() returns 04/30/2004 NOT 05/01/2004.

On Windows, try Australia/Brisbane. The time is out by 2 hours - 5/2/2004 12:27:59 AM  instead of 5/2/2004 10:27.59 AM.
 [2004-05-02 07:52 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Not a bug as Julian Days start at noon, not at midnight, if you shift to 13:00 you\'ll see that it works fine.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 11:01:27 2024 UTC