From 39d808f8e0db6b8b4b715b329a5ddd98009d6aa5 Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Mon, 2 Jan 2012 08:20:03 +0000 Subject: [PATCH] (Half of bug 33454) The week based year number (format char 'o') was being calculated based on server timezone instead of UTC in sprintfDate. [follow-up r45208] This would cause a couple incorrect results on new years day. --- RELEASE-NOTES-1.19 | 2 ++ languages/Language.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 5855e3e465..32d35a3c72 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -209,6 +209,8 @@ production. prevent inheritance to nested tables which caused various issues * (bug 32686) Tooltip on links to non-existing pages are now always in user's language +* (bug 33454) ISO-8601 week-based year number (format character 'o') is now + calculated correctly with respect to timezone === API changes in 1.19 === * (bug 19838) siprop=interwikimap can now use the interwiki cache. diff --git a/languages/Language.php b/languages/Language.php index 7b8d8aafc2..b204626746 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -1045,7 +1045,7 @@ class Language { if ( !$unix ) { $unix = wfTimestamp( TS_UNIX, $ts ); } - $num = date( 'o', $unix ); + $num = gmdate( 'o', $unix ); break; case 'Y': $num = substr( $ts, 0, 4 ); -- 2.20.1