From bfc53ad061fd6adeeaf865235fee9555a9fb2e53 Mon Sep 17 00:00:00 2001 From: Matt Martin Date: Mon, 19 Jul 1999 07:17:32 +0000 Subject: Handle the 'Z' parameter to the ISO date format to convert from GMT time. 1999-07-19 Matt Martin * timeutil.c (time_from_isodate): Handle the 'Z' parameter to the ISO date format to convert from GMT time. svn path=/trunk/; revision=1030 --- calendar/timeutil.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'calendar/timeutil.c') diff --git a/calendar/timeutil.c b/calendar/timeutil.c index 10b9483af0..78c1c46d56 100644 --- a/calendar/timeutil.c +++ b/calendar/timeutil.c @@ -18,6 +18,9 @@ time_from_isodate (char *str) struct tm my_tm; time_t t; + if (strlen (str) < 14) + return -1; + my_tm.tm_year = (digit_at (str, 0) * 1000 + digit_at (str, 1) * 100 + digit_at (str, 2) * 10 + digit_at (str, 3)) - 1900; @@ -29,6 +32,10 @@ time_from_isodate (char *str) my_tm.tm_isdst = -1; t = mktime (&my_tm); + + if (str [15] == 'Z') + t -= timezone; + return t; } -- cgit v1.2.3