note 45295 added to function.jddayofweek

From: Date: Wed, 01 Sep 2004 13:41:42 +0000
Subject: note 45295 added to function.jddayofweek
Groups: php.notes 
Request: Send a blank email to php-notes+get-75839@lists.php.net to get a copy of this message
An interesting test, try running this code: $year = 2004; for ($mon = 1; $mon <= 12; $mon++) { $firstDay = jddayofweek(gregoriantojd(1, $mon, $year), 0); echo "1/$mon/$year -> $firstDay "; echo jddayofweek(gregoriantojd(1, $mon, $year), 1); $testtime = mktime(12, 0, 0, $mon, 1, $year); echo ' - '; echo date('r', $testtime); echo "<br>\n"; } Notice the discrepency between the start days? .. writing a calendar program I noticed it since my months weren't lining up with the respective days, i.e. end of one month 'overlapped' the start of the next one using the jddayofweek / gregoriantojd thing. Or was I using it wrong to begin with? Like others I have reverted to using 'date('w', $time);' instead. ---- Manual Page -- http://www.php.net/manual/en/function.jddayofweek.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+45295 Delete -- http://master.php.net/manage/user-notes.php?action=delete+45295&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+45295&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#75839) next »