Bug #15272 [Com]: JDDayOfWeek result wrong by one day

From: Date: Wed, 10 Sep 2014 00:11:35 +0000
Subject: Bug #15272 [Com]: JDDayOfWeek result wrong by one day
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-187483@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=15272&edit=1 ID: 15272 Comment by: icon_land2003 at yahoo dot com dot au Reported by: ncb999 at NOSPAMhotmail dot com Summary: JDDayOfWeek result wrong by one day Status: Not a bug Type: Bug Package: Calendar related Operating System: WinXP PHP Version: 4.1.1 Block user comment: N Private report: N New Comment: $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...??? Previous Comments: ------------------------------------------------------------------------ [2002-04-18 13:56:27] 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.) ------------------------------------------------------------------------ [2002-04-09 18:58:34] 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-01-29 04:17:48] 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. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=15272&edit=1

« previous php.bugs (#187483) next »