php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15272 JDDayOfWeek result wrong by one day
Submitted: 2002-01-29 04:17 UTC Modified: 2002-04-18 13:56 UTC
From: ncb999 at NOSPAMhotmail dot com Assigned:
Status: Not a bug Package: Calendar related
PHP Version: 4.1.1 OS: WinXP
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:
31 - 28 = ?
Subscribe to this entry?

 
 [2002-01-29 04:17 UTC] ncb999 at NOSPAMhotmail dot com
JDDayOfWeek returns a result which is wrong by one day, for instance it says that Jan. 29th, 2002 is a 1, Monday, or Mon, depending on the mode. That date is actually a Tuesday.

I'm using the standard ISAPI build 4.1.1 downloaded from PHP.net, with the php_gd.dll library.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-09 18:58 UTC] jimw@php.net
works just fine for me. my test code:

<?php
$ts = mktime(12,0,0,1,29,2002);
$jd = unixtojd($ts);
echo jddayofweek($jd); # outputs '2'
 [2002-04-18 13:56 UTC] jimw@php.net
as it turns out, the reporter was using juliantojd() to convert a gregorian date.

(this note for the benefit of anyone searching the bug database because they make the same mistake.)
 [2014-09-10 00:11 UTC] icon_land2003 at yahoo dot com dot au
$jd = unixtojd(); //unix sec since 1970 to julian day
$day = JDDayOfWeek($jd); //displays day of week, sunday = 0 - sat = 6

echo $day; // Keeps giving me 4 and today is wednesday...???
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Feb 19 16:01:32 2020 UTC