fix sending correct time with DST / non-DST time
This commit is contained in:
parent
7c96178126
commit
626b080457
|
@ -1640,7 +1640,8 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
|
||||||
qp = iq_obj.setTag('time',
|
qp = iq_obj.setTag('time',
|
||||||
namespace=common.xmpp.NS_TIME_REVISED)
|
namespace=common.xmpp.NS_TIME_REVISED)
|
||||||
qp.setTagData('utc', strftime('%Y-%m-%dT%H:%M:%SZ', gmtime()))
|
qp.setTagData('utc', strftime('%Y-%m-%dT%H:%M:%SZ', gmtime()))
|
||||||
zone = -(timezone, altzone)[daylight] / 60
|
isdst = time.localtime().tm_isdst
|
||||||
|
zone = -(timezone, altzone)[isdst] / 60
|
||||||
tzo = (zone / 60, abs(zone % 60))
|
tzo = (zone / 60, abs(zone % 60))
|
||||||
qp.setTagData('tzo', '%+03d:%02d' % (tzo))
|
qp.setTagData('tzo', '%+03d:%02d' % (tzo))
|
||||||
self.connection.send(iq_obj)
|
self.connection.send(iq_obj)
|
||||||
|
|
Loading…
Reference in New Issue