note 45295 deleted from function.jddayofweek by didou

From: Date: Mon, 10 Jan 2005 01:06:00 +0000
Subject: note 45295 deleted from function.jddayofweek by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-83014@lists.php.net to get a copy of this message
Note Submitter: spam at doofer dot org ---- 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.

« previous php.notes (#83014) next »