aboutsummaryrefslogtreecommitdiffstats
path: root/libical/src
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@helixcode.com>2000-12-14 14:09:25 +0800
committerFederico Mena Quintero <federico@src.gnome.org>2000-12-14 14:09:25 +0800
commit55d696992dac8e8650d8d98b367e231e564212cd (patch)
treef065c14fe4242e045a3de59cd0ef8d1a1ada7046 /libical/src
parent5ff2d06f63f5596ac2bd8f991f5f207fe92e6f1f (diff)
downloadgsoc2013-evolution-55d696992dac8e8650d8d98b367e231e564212cd.tar
gsoc2013-evolution-55d696992dac8e8650d8d98b367e231e564212cd.tar.gz
gsoc2013-evolution-55d696992dac8e8650d8d98b367e231e564212cd.tar.bz2
gsoc2013-evolution-55d696992dac8e8650d8d98b367e231e564212cd.tar.lz
gsoc2013-evolution-55d696992dac8e8650d8d98b367e231e564212cd.tar.xz
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
Diffstat (limited to 'libical/src')
-rw-r--r--libical/src/libical/icaltime.c7
1 files changed, 3 insertions, 4 deletions
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;