Extend limits of allowed time zone offsets
This commit is contained in:
committed by
Dimitri Schoolwerth
parent
af309e6d96
commit
9b9f8ac468
@@ -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;
|
||||
|
@@ -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.
|
||||
|
||||
|
Reference in New Issue
Block a user