XMPP time example for XMPPpy: различия между версиями
Материал из Linux Wiki
Перейти к навигацииПерейти к поиску
Rain (обсуждение | вклад) (Новая страница: «<source lang=python> def iq_time_handler(self, iq, typ): repl = iq.buildReply('result') query = Node('time') query.setTagData(tag='tzo', val="+02:00") query.setTagData(tag='utc', val=time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime())) repl.setPayload([query]) self.jabber.send(repl) raise NodeProcessed </source> Category:Python») |
(нет различий)
|
Версия 20:31, 11 марта 2023
def iq_time_handler(self, iq, typ):
repl = iq.buildReply('result')
query = Node('time')
query.setTagData(tag='tzo', val="+02:00")
query.setTagData(tag='utc', val=time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime()))
repl.setPayload([query])
self.jabber.send(repl)
raise NodeProcessed