different).
-/* Generated by re2c 0.13.5 on Tue Jul 15 19:21:36 2008 */
+/* Generated by re2c 0.13.5 on Wed Jul 16 17:24:19 2008 */
#line 1 "ext/date/lib/parse_date.re"
/*
+----------------------------------------------------------------------+
}
#endif
/* If we have a TimeZone identifier to start with, use it */
- if (strstr(tz_abbr, "/")) {
+ if (strstr(tz_abbr, "/") || strcmp(tz_abbr, "UTC") == 0) {
if ((res = timelib_parse_tzfile(tz_abbr, tzdb)) != NULL) {
t->tz_info = res;
t->zone_type = TIMELIB_ZONETYPE_ID;
}
#endif
/* If we have a TimeZone identifier to start with, use it */
- if (strstr(tz_abbr, "/")) {
+ if (strstr(tz_abbr, "/") || strcmp(tz_abbr, "UTC") == 0) {
if ((res = timelib_parse_tzfile(tz_abbr, tzdb)) != NULL) {
t->tz_info = res;
t->zone_type = TIMELIB_ZONETYPE_ID;
--- /dev/null
+--TEST--
+Bug #45529 (UTC not properly recognised as timezone identifier while parsing)
+--FILE--
+<?php
+$tz1 = new DateTimeZone('UTC');
+$tz2 = date_create('UTC')->getTimeZone();
+echo $tz1->getName(), PHP_EOL;
+echo $tz2->getName(), PHP_EOL;
+$d = new DateTime('2008-01-01 12:00:00+0200');
+$d->setTimeZone($tz1);
+echo $d->format(DATE_ISO8601), PHP_EOL;
+$d = new DateTime('2008-01-01 12:00:00+0200');
+$d->setTimeZone($tz2);
+echo $d->format(DATE_ISO8601), PHP_EOL;
+?>
+--EXPECT--
+UTC
+UTC
+2008-01-01T10:00:00+0000
+2008-01-01T10:00:00+0000