https://bugzilla.wikimedia.org/show_bug.cgi?id=17080
Brad Jorsch <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] Severity|critical |normal Keywords| |patch Summary|Dates are a day behind |#time parserfunction parses | |dates in the PHP default | |timezone before converting | |to UTC --- Comment #5 from Brad Jorsch <[email protected]> 2009-01-19 17:59:27 UTC --- The issue is that #time parses dates without an explicitly specified timezone in the PHP default timezone and then converts that to UTC. If the PHP default timezone happens to be UTC, all is good. If the PHP default is east of UTC, we get this obvious problem, and if it is west of UTC we get problems in less obvious cases. For example, {{#time:Y-m-d|2009-01-01}} parses the date at midnight in the PHP default timezone, which might result in DateTime object containing the time "2009-01-01T00:00:00+01:00". #time then converts this to UTC, resulting in "2008-12-31T23:00:00+00:00", giving "2008-12-31" rather than the expected "2009-01-01" as the output. It would probably make more sense to have #time use UTC as the default, and #timel the $wgLocaltimezone time. This can be done easily by specifying the second parameter to DateTime::__construct for the modern PHP case, and setting TZ before the strtotime() (instead of only for the date() call) should suffice for the fallback case. -- Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. You are on the CC list for the bug. _______________________________________________ Wikibugs-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
