diff options
author | Federico Mena Quintero <federico@helixcode.com> | 2000-12-14 14:09:25 +0800 |
---|---|---|
committer | Federico Mena Quintero <federico@src.gnome.org> | 2000-12-14 14:09:25 +0800 |
commit | 55d696992dac8e8650d8d98b367e231e564212cd (patch) | |
tree | f065c14fe4242e045a3de59cd0ef8d1a1ada7046 | |
parent | 5ff2d06f63f5596ac2bd8f991f5f207fe92e6f1f (diff) | |
download | gsoc2013-evolution-55d696992dac8e8650d8d98b367e231e564212cd.tar.gz gsoc2013-evolution-55d696992dac8e8650d8d98b367e231e564212cd.tar.zst gsoc2013-evolution-55d696992dac8e8650d8d98b367e231e564212cd.zip |
Use gmtime() unconditionally, since we want an UTC broken-down
2000-12-13 Federico Mena Quintero <federico@helixcode.com>
* src/libical/icaltime.c (icaltime_from_timet): Use gmtime()
unconditionally, since we want an UTC broken-down representation.
(icaltime_as_timet): Add the offset only if the time was supposed
to be in UTC; that way mktime() will get a proper localtime as
source data.
svn path=/trunk/; revision=6996
-rw-r--r-- | libical/ChangeLog | 8 | ||||
-rw-r--r-- | libical/src/libical/icaltime.c | 7 |
2 files changed, 11 insertions, 4 deletions
diff --git a/libical/ChangeLog b/libical/ChangeLog index d686ba26e7..0d70241538 100644 --- a/libical/ChangeLog +++ b/libical/ChangeLog @@ -1,5 +1,13 @@ 2000-12-13 Federico Mena Quintero <federico@helixcode.com> + * src/libical/icaltime.c (icaltime_from_timet): Use gmtime() + unconditionally, since we want an UTC broken-down representation. + (icaltime_as_timet): Add the offset only if the time was supposed + to be in UTC; that way mktime() will get a proper localtime as + source data. + +2000-12-13 Federico Mena Quintero <federico@helixcode.com> + * src/libical/icaltime.c (icaltime_from_timet): time_t values *are* in UTC by definition, so the is_utc argument is useless. Removed the conversion to UTC and made the icaltimetype.is_utc be diff --git a/libical/src/libical/icaltime.c b/libical/src/libical/icaltime.c index 946a0115e9..4cdd3a9f0d 100644 --- a/libical/src/libical/icaltime.c +++ b/libical/src/libical/icaltime.c @@ -45,7 +45,7 @@ icaltime_from_timet(time_t tm, int is_date, int is_utc) } #endif - t = *(localtime(&tm)); + t = *(gmtime(&tm)); tt.second = t.tm_sec; tt.minute = t.tm_min; @@ -80,10 +80,9 @@ time_t icaltime_as_timet(struct icaltimetype tt) stm.tm_isdst = -1; /* prevents mktime from changing hour based on daylight savings */ - if(tt.is_utc == 0){ + if(tt.is_utc) stm.tm_sec -= icaltime_local_utc_offset(); - } - + tut = mktime(&stm); return tut; |