Explicitly disambiguate local time zone from UTC
Don't rely on time zone offset to check whether it is local as this doesn't, and can't, work for the local time zone in Great Britain which uses the same offset as UTC, but does use DST, unlike the latter. Add a unit test (albeit disabled by default) checking that the code that previously didn't work correctly in BST does work now (run the tests using "TZ=Europe/London ./test wxDateTime-BST-bugs" under Unix to test). Closes #14317, #17220. See #10445.
This commit is contained in:
@@ -306,7 +306,9 @@ public:
|
||||
return tz;
|
||||
}
|
||||
|
||||
long GetOffset() const { return m_offset; }
|
||||
bool IsLocal() const { return m_offset == -1; }
|
||||
|
||||
long GetOffset() const;
|
||||
|
||||
private:
|
||||
// offset for this timezone from GMT in seconds
|
||||
|
Reference in New Issue
Block a user