aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/timeutil.c
diff options
context:
space:
mode:
authorMatt Martin <matt@abacusnet.net>1999-07-19 15:17:32 +0800
committerArturo Espinosa <unammx@src.gnome.org>1999-07-19 15:17:32 +0800
commitbfc53ad061fd6adeeaf865235fee9555a9fb2e53 (patch)
tree0c7af64774a0f0d138ebbf3713f92f651e5dd8a4 /calendar/timeutil.c
parent19e315ed069021c7eb67e965929c43464d601926 (diff)
downloadgsoc2013-evolution-bfc53ad061fd6adeeaf865235fee9555a9fb2e53.tar
gsoc2013-evolution-bfc53ad061fd6adeeaf865235fee9555a9fb2e53.tar.gz
gsoc2013-evolution-bfc53ad061fd6adeeaf865235fee9555a9fb2e53.tar.bz2
gsoc2013-evolution-bfc53ad061fd6adeeaf865235fee9555a9fb2e53.tar.lz
gsoc2013-evolution-bfc53ad061fd6adeeaf865235fee9555a9fb2e53.tar.xz
gsoc2013-evolution-bfc53ad061fd6adeeaf865235fee9555a9fb2e53.tar.zst
gsoc2013-evolution-bfc53ad061fd6adeeaf865235fee9555a9fb2e53.zip
Handle the 'Z' parameter to the ISO date format to convert from GMT time.
1999-07-19 Matt Martin <matt@abacusnet.net> * timeutil.c (time_from_isodate): Handle the 'Z' parameter to the ISO date format to convert from GMT time. svn path=/trunk/; revision=1030
Diffstat (limited to 'calendar/timeutil.c')
-rw-r--r--calendar/timeutil.c7
1 files changed, 7 insertions, 0 deletions
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;
}