diff options
author | Eugene Lamskoy | 2023-02-22 18:02:10 +0200 |
---|---|---|
committer | Eugene Lamskoy | 2023-02-22 18:02:10 +0200 |
commit | 9ab3feaeafbf9dae6a22160e3f553da8931acf34 (patch) | |
tree | 25eef03c28362d990fb93c0c9b805c97276e1154 /timezonedb-guess.patch | |
parent | 2047899ce96ed15a2b7a69615cc82989c0d98156 (diff) | |
download | aur-9ab3feaeafbf9dae6a22160e3f553da8931acf34.tar.gz |
php56 modern version
Diffstat (limited to 'timezonedb-guess.patch')
-rw-r--r-- | timezonedb-guess.patch | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/timezonedb-guess.patch b/timezonedb-guess.patch new file mode 100644 index 000000000000..10c057e40799 --- /dev/null +++ b/timezonedb-guess.patch @@ -0,0 +1,27 @@ +index cf4a11b..f2ea919 100644 +--- a/ext/date/php_date.c ++++ b/ext/date/php_date.c +@@ -545,6 +545,23 @@ static char* guess_timezone(const timelib_tzdb *tzdb) + DATEG(timezone_valid) = 1; + return DATEG(default_timezone); + } ++ /* Try to guess timezone from system information */ ++ { ++ struct tm *ta, tmbuf; ++ time_t the_time; ++ char *tzid = NULL; ++ ++ the_time = time(NULL); ++ ta = php_localtime_r(&the_time, &tmbuf); ++ if (ta) { ++ tzid = timelib_timezone_id_from_abbr(ta->tm_zone, ta->tm_gmtoff, ta->tm_isdst); ++ } ++ if (! tzid) { ++ tzid = "UTC"; ++ } ++ ++ return tzid; ++ } + /* Fallback to UTC */ + return "UTC"; + } |