changeset 703:8cbcbff8de7d

Fix UTC time in IQ:version queries
author Mikael Berthe <mikael@lilotux.net>
date Wed, 15 Feb 2006 23:00:49 +0100
parents 3e34bd8e073d
children 4118a66f2c02
files mcabber/src/jab_iq.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/src/jab_iq.c	Wed Feb 15 22:54:45 2006 +0100
+++ b/mcabber/src/jab_iq.c	Wed Feb 15 23:00:49 2006 +0100
@@ -479,7 +479,6 @@
   struct tm *now;
 
   time(&now_t);
-  now = localtime(&now_t);
 
   // "from" has already been converted to user locale
   scr_LogPrint(LPRINT_LOGNORM, "Received an IQ time request from <%s>", from);
@@ -492,9 +491,13 @@
   xmlnode_put_attrib(x, "to", xmlnode_get_attrib(xmldata, "from"));
   myquery = xmlnode_get_tag(x, "query");
 
+  now = gmtime(&now_t);
+
   strftime(buf, 512, "%Y%m%dT%T", now);
   xmlnode_insert_cdata(xmlnode_insert_tag(myquery, "utc"), buf, -1);
 
+  now = localtime(&now_t);
+
   strftime(buf, 512, "%Z", now);
   if ((utf8_buf = to_utf8(buf))) {
     xmlnode_insert_cdata(xmlnode_insert_tag(myquery, "tz"), utf8_buf, -1);