aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorTimur Bakeyev <mc@bat.ru>1999-09-28 09:16:19 +0800
committerTimur I. Bakeyev <timur@src.gnome.org>1999-09-28 09:16:19 +0800
commita71f1f98d4f0a2bc9cb47f820c6b03724629aee5 (patch)
tree283aeafe47623b29c98edf2b5f3a304a86006bfc /calendar
parentfb061173a5784d9082525865ddc4dfcff2b24f06 (diff)
downloadgsoc2013-evolution-a71f1f98d4f0a2bc9cb47f820c6b03724629aee5.tar.gz
gsoc2013-evolution-a71f1f98d4f0a2bc9cb47f820c6b03724629aee5.tar.zst
gsoc2013-evolution-a71f1f98d4f0a2bc9cb47f820c6b03724629aee5.zip
Use tm.gmtoff or timezone to get correct offset from UTC, according to
1999-09-27 Timur Bakeyev <mc@bat.ru> * timeutil.c (time_from_isodate): Use tm.gmtoff or timezone to get correct offset from UTC, according to HAVE_TM_GMTOFF or HAVE_TIMEZONE. See also 1999-07-19 Matt Martin <matt@abacusnet.net> svn path=/trunk/; revision=1316
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog7
-rw-r--r--calendar/timeutil.c11
2 files changed, 15 insertions, 3 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 1dcc43d0fb..77cfeabff4 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,9 @@
+1999-09-27 Timur Bakeyev <mc@bat.ru>
+
+ * timeutil.c (time_from_isodate): Use tm.gmtoff or timezone to get
+ correct offset from UTC, according to HAVE_TM_GMTOFF or HAVE_TIMEZONE.
+ See also 1999-07-19 Matt Martin <matt@abacusnet.net>
+
1999-09-27 Miguel de Icaza <miguel@nuclecu.unam.mx>
* month-view.c (add_event): ditto
@@ -23,6 +29,7 @@
values returned from localtime, as it uses a static buffer.
1999-09-26 Eskil Olsen <deity@eskil.dk>
+
* corba-cal.c: the g_free that was commented out since glib said
was a duplicate free, was supposed to be a free.
diff --git a/calendar/timeutil.c b/calendar/timeutil.c
index 78c1c46d56..7ddc0e04d4 100644
--- a/calendar/timeutil.c
+++ b/calendar/timeutil.c
@@ -34,7 +34,12 @@ time_from_isodate (char *str)
t = mktime (&my_tm);
if (str [15] == 'Z')
- t -= timezone;
+#if defined(HAVE_TM_GMTOFF)
+ t -= my_tm.tm_gmtoff
+#elsif defined(HAVE_TIMEZONE)
+ t -= timezone
+#endif
+ ;
return t;
}
@@ -86,11 +91,11 @@ format_simple_hour (int hour, int use_am_pm)
*/
if (use_am_pm)
- sprintf (buf, "%d%s",
+ g_snprintf (buf, sizeof(buf), "%d%s",
(hour == 0) ? 12 : (hour > 12) ? (hour - 12) : hour,
(hour < 12) ? _("am") : _("pm"));
else
- sprintf (buf, "%02d%s", hour, _("h"));
+ g_snprintf (buf, sizeof(buf), "%02d%s", hour, _("h"));
return buf;