diff --git a/src/common/datetimefmt.cpp b/src/common/datetimefmt.cpp index 1ce36770ac..78feafc962 100644 --- a/src/common/datetimefmt.cpp +++ b/src/common/datetimefmt.cpp @@ -1549,7 +1549,14 @@ wxDateTime::ParseFormat(const wxString& date, } } - if ( hours > 12 || minutes > 59 ) + /* + Contemporary offset limits are -12:00 and +14:00. + However historically offsets of over +/- 15 hours + existed so be a bit more flexible. Info retrieved + from Time Zone Database at + https://www.iana.org/time-zones. + */ + if ( hours > 15 || minutes > 59 ) return false; // bad format timeZone = 3600*hours + 60*minutes; diff --git a/tests/datetime/datetimetest.cpp b/tests/datetime/datetimetest.cpp index 4b407760a3..e0c146611f 100644 --- a/tests/datetime/datetimetest.cpp +++ b/tests/datetime/datetimetest.cpp @@ -925,8 +925,8 @@ void DateTimeTestCase::TestTimeZoneParse() // Some invalid ones too. - { "00:00-1300" }, // Offset out of range. - { "00:00+1300" }, // Offset out of range. + { "00:00-1600" }, // Offset out of range. + { "00:00+1600" }, // Offset out of range. { "00:00+00:" }, // Minutes missing after colon separator.