php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #63391
Patch pre_1600_day_of_week_fix revision 2013-11-28 06:21 UTC by tcarter at noggin dot com dot au

Patch pre_1600_day_of_week_fix for Date/time related Bug #63391

Patch version 2013-11-28 06:21 UTC

Return to Bug #63391 | Download this patch
Patch Revisions:

Developer: tcarter@noggin.com.au

Index: ext/date/lib/dow.c
===================================================================
--- ext/date/lib/dow.c	(revision 328126)
+++ ext/date/lib/dow.c	(working copy)
@@ -25,10 +25,7 @@
 
 static timelib_sll century_value(timelib_sll j)
 {
-	timelib_sll i = j - 17;
-	timelib_sll c = (4 - i * 2 + (i + 1) / 4) % 7;
-
-	return c < 0 ? c + 7 : c;
+	return 6 - (j%4)*2;
 }
 
 static timelib_sll timelib_day_of_week_ex(timelib_sll y, timelib_sll m, timelib_sll d, int iso)
 
PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Fri Sep 04 18:01:27 2015 UTC