1 From: Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>
2 Date: Sat, 2 May 2015 10:26:56 +0200
3 Subject: Use system timezone
5 Upstream don't want this patch. See
6 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=730771 for a summary.
8 This delta is recovered from previous versions of the system timezone patch in
9 Debian, and appears to have inadvertently been dropped. Author unknown.
11 To be used in tandem with use_embedded_timezonedb.patch and use_embedded_timezonedb_fixes.patch.
13 ext/date/php_date.c | 17 +++++++++++++++++
14 1 file changed, 17 insertions(+)
16 diff --git a/ext/date/php_date.c b/ext/date/php_date.c
17 index cbe6e91..1999c83 100644
18 --- a/ext/date/php_date.c
19 +++ b/ext/date/php_date.c
20 @@ -1003,6 +1003,23 @@ static char* guess_timezone(const timelib_tzdb *tzdb)
21 DATEG(timezone_valid) = 1;
22 return DATEG(default_timezone);
24 + /* Try to guess timezone from system information */
26 + struct tm *ta, tmbuf;
30 + the_time = time(NULL);
31 + ta = php_localtime_r(&the_time, &tmbuf);
33 + tzid = timelib_timezone_id_from_abbr(ta->tm_zone, ta->tm_gmtoff, ta->tm_isdst);