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 --- a/ext/date/php_date.c
17 +++ b/ext/date/php_date.c
18 @@ -549,6 +549,23 @@ static char* guess_timezone(const timeli
19 } else if (*DATEG(default_timezone)) {
20 return DATEG(default_timezone);
22 + /* Try to guess timezone from system information */
24 + struct tm *ta, tmbuf;
28 + the_time = time(NULL);
29 + ta = php_localtime_r(&the_time, &tmbuf);
31 + tzid = timelib_timezone_id_from_abbr(ta->tm_zone, ta->tm_gmtoff, ta->tm_isdst);