|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-06-16 21:56 UTC] derick@php.net
[2008-06-24 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 21 19:00:01 2025 UTC |
Description: ------------ My php.ini: [Date] ; Defines the default timezone used by the date functions date.timezone = "America/New_York" When using the new DateTime() function: without explicitly setting the actual timezone in code, no timezone is recognized. Also, when using date_default_timezone_set(), you can't depend on date_default_timezone_get() to get the .ini setting. It doesn't work. Reproduce code: --------------- date_default_timezone_set(date_default_timezone_get()); $datetime = new DateTime(); $datetime->format('G'), 0, 0); // top of hour echo $datetime->format(DATE_RFC3339); Expected result: ---------------- 2008-06-16T18:00:00+01:00 Actual result: -------------- 2008-06-16T18:00:00+00:00