aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2010-06-29 10:13:36 +0000
committerJeremy Lainé <jeremy.laine@m4x.org>2010-06-29 10:13:36 +0000
commit1e18c93ea2571a05380e6458204bbef10f2a5a5c (patch)
tree8db11d7169a6185c04a6b7de84bcec0342aacaae /source
parent99424002b025fadb0d0ee815d2e934d3f76214e2 (diff)
downloadqxmpp-1e18c93ea2571a05380e6458204bbef10f2a5a5c.tar.gz
don't write milliseconds when they are zero
Diffstat (limited to 'source')
-rw-r--r--source/QXmppUtils.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/QXmppUtils.cpp b/source/QXmppUtils.cpp
index bf58706b..46cbde8b 100644
--- a/source/QXmppUtils.cpp
+++ b/source/QXmppUtils.cpp
@@ -65,7 +65,11 @@ QDateTime datetimeFromString(const QString &str)
QString datetimeToString(const QDateTime &dt)
{
- return dt.toUTC().toString("yyyy-MM-ddThh:mm:ss.zzzZ");
+ QDateTime utc = dt.toUTC();
+ if (utc.time().msec())
+ return utc.toString("yyyy-MM-ddThh:mm:ss.zzzZ");
+ else
+ return utc.toString("yyyy-MM-ddThh:mm:ssZ");
}
QString jidToResource(const QString& jid)