From f4da566b9486fdb830318015255f1d060e1c44e6 Mon Sep 17 00:00:00 2001 From: Richard Frith-Macdonald Date: Fri, 22 Jan 2021 10:34:06 +0000 Subject: [PATCH] Simple check for timezone adjustments around 1970 --- Tests/base/NSCalendarDate/test00.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Tests/base/NSCalendarDate/test00.m b/Tests/base/NSCalendarDate/test00.m index b87b20247..47044a203 100644 --- a/Tests/base/NSCalendarDate/test00.m +++ b/Tests/base/NSCalendarDate/test00.m @@ -99,6 +99,13 @@ int main() PASS(date1 != nil, "+dateWithString:calendarFormat:locale: handles GMT-0100 timezone"); + date1 = [NSCalendarDate dateWithString: @"1970-01-01 00:00:00 GMT+1000" + calendarFormat: @"%Y-%m-%d %H:%M:%S %Z" + locale: locale]; + [date1 setTimeZone: [NSTimeZone timeZoneWithName: @"GMT"]]; + PASS_EQUAL([date1 description], @"1969-12-31 14:00:00 GMT+0000", + "+dateWithString:calendarFormat:locale: handles GMT+1000 timezone"); + date1 = [NSCalendarDate dateWithString: @"1999-12-31 00:00:00 Africa/Addis_Ababa" calendarFormat: @"%Y-%m-%d %H:%M:%S %Z"