Skip to content

Commit e7e1bf0

Browse files
committed
Merge branch 'mc/maint-zoneparse' into maint
* mc/maint-zoneparse: Add "Z" as an alias for the timezone "UTC"
2 parents 7a0d54f + 75b37e7 commit e7e1bf0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

date.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ static const struct {
229229

230230
{ "GMT", 0, 0, }, /* Greenwich Mean */
231231
{ "UTC", 0, 0, }, /* Universal (Coordinated) */
232+
{ "Z", 0, 0, }, /* Zulu, alias for UTC */
232233

233234
{ "WET", 0, 0, }, /* Western European */
234235
{ "BST", 0, 1, }, /* British Summer */
@@ -305,7 +306,7 @@ static int match_alpha(const char *date, struct tm *tm, int *offset)
305306

306307
for (i = 0; i < ARRAY_SIZE(timezone_names); i++) {
307308
int match = match_string(date, timezone_names[i].name);
308-
if (match >= 3) {
309+
if (match >= 3 || match == strlen(timezone_names[i].name)) {
309310
int off = timezone_names[i].offset;
310311

311312
/* This is bogus, but we like summer */

0 commit comments

Comments
 (0)