aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-message.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2002-09-05 22:26:30 +0800
committerDan Winship <danw@src.gnome.org>2002-09-05 22:26:30 +0800
commit15af11c98844a2ce5f5c5526a635a495ebbfdd89 (patch)
tree4bc7abfe29283c873f8ca091f684c4839e58018f /camel/camel-mime-message.c
parent9c2d49aa469eb1cbd89bb4b4021add3a8e34d3e2 (diff)
downloadgsoc2013-evolution-15af11c98844a2ce5f5c5526a635a495ebbfdd89.tar
gsoc2013-evolution-15af11c98844a2ce5f5c5526a635a495ebbfdd89.tar.gz
gsoc2013-evolution-15af11c98844a2ce5f5c5526a635a495ebbfdd89.tar.bz2
gsoc2013-evolution-15af11c98844a2ce5f5c5526a635a495ebbfdd89.tar.lz
gsoc2013-evolution-15af11c98844a2ce5f5c5526a635a495ebbfdd89.tar.xz
gsoc2013-evolution-15af11c98844a2ce5f5c5526a635a495ebbfdd89.tar.zst
gsoc2013-evolution-15af11c98844a2ce5f5c5526a635a495ebbfdd89.zip
Use e_mktime_utc.
* camel-mime-utils.c (header_decode_date): Use e_mktime_utc. * camel-mime-message.c (camel_mime_message_set_date): Use e_localtime_with_offset. * broken-date-parser.c (decode_broken_date): Use e_mktime_utc. svn path=/trunk/; revision=17986
Diffstat (limited to 'camel/camel-mime-message.c')
-rw-r--r--camel/camel-mime-message.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/camel/camel-mime-message.c b/camel/camel-mime-message.c
index 0b21d98a57..7f7a35466d 100644
--- a/camel/camel-mime-message.c
+++ b/camel/camel-mime-message.c
@@ -47,6 +47,8 @@
#include "camel-mime-filter-charset.h"
#include "camel-mime-filter-bestenc.h"
+#include "e-time-utils.h"
+
#define d(x)
/* these 2 below should be kept in sync */
@@ -202,22 +204,12 @@ camel_mime_message_set_date (CamelMimeMessage *message, time_t date, int offset
g_assert(message);
if (date == CAMEL_MESSAGE_DATE_CURRENT) {
- struct tm *local;
+ struct tm local;
int tz;
date = time(0);
- local = localtime(&date);
-#if defined(HAVE_TIMEZONE)
- tz = timezone;
-#elif defined(HAVE_TM_GMTOFF)
- tz = -local->tm_gmtoff;
-#endif
- offset = -(((tz/60/60) * 100) + (tz/60 % 60));
-#ifdef HAVE_TIMEZONE
- /* tm.tm_gmtoff is already adjusted for DST */
- if (local->tm_isdst>0)
- offset += 100;
-#endif
+ e_localtime_with_offset(date, &local, &tz);
+ offset = (((tz/60/60) * 100) + (tz/60 % 60));
}
message->date = date;
message->date_offset = offset;