summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0082.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-06-19 21:50:33 -0700
committerLance Stout <lancestout@gmail.com>2012-06-19 21:50:33 -0700
commit5820d49cd401a1362a8a675c4b91935adb1240fe (patch)
treef40f78839ae3004bfb0b8da1ae93d61759d8ad66 /sleekxmpp/plugins/xep_0082.py
parent1ab66e576786ecb0cfb9b6b163811735564b951b (diff)
parent36c11ad9de7c1b5a199aa5a4302e33085513c126 (diff)
downloadslixmpp-5820d49cd401a1362a8a675c4b91935adb1240fe.tar.gz
slixmpp-5820d49cd401a1362a8a675c4b91935adb1240fe.tar.bz2
slixmpp-5820d49cd401a1362a8a675c4b91935adb1240fe.tar.xz
slixmpp-5820d49cd401a1362a8a675c4b91935adb1240fe.zip
Merge branch 'master' into develop
Conflicts: sleekxmpp/basexmpp.py
Diffstat (limited to 'sleekxmpp/plugins/xep_0082.py')
-rw-r--r--sleekxmpp/plugins/xep_0082.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/sleekxmpp/plugins/xep_0082.py b/sleekxmpp/plugins/xep_0082.py
index 96eb331a..02571fa7 100644
--- a/sleekxmpp/plugins/xep_0082.py
+++ b/sleekxmpp/plugins/xep_0082.py
@@ -42,6 +42,7 @@ def format_date(time_obj):
time_obj = time_obj.date()
return time_obj.isoformat()
+
def format_time(time_obj):
"""
Return a formatted string version of a time object.
@@ -60,6 +61,7 @@ def format_time(time_obj):
return '%sZ' % timestamp
return timestamp
+
def format_datetime(time_obj):
"""
Return a formatted string version of a datetime object.
@@ -76,6 +78,7 @@ def format_datetime(time_obj):
return '%sZ' % timestamp
return timestamp
+
def date(year=None, month=None, day=None, obj=False):
"""
Create a date only timestamp for the given instant.
@@ -98,9 +101,10 @@ def date(year=None, month=None, day=None, obj=False):
day = today.day
value = dt.date(year, month, day)
if obj:
- return value
+ return value
return format_date(value)
+
def time(hour=None, min=None, sec=None, micro=None, offset=None, obj=False):
"""
Create a time only timestamp for the given instant.
@@ -136,6 +140,7 @@ def time(hour=None, min=None, sec=None, micro=None, offset=None, obj=False):
return value
return format_time(value)
+
def datetime(year=None, month=None, day=None, hour=None,
min=None, sec=None, micro=None, offset=None,
separators=True, obj=False):
@@ -181,7 +186,7 @@ def datetime(year=None, month=None, day=None, hour=None,
value = dt.datetime(year, month, day, hour,
min, sec, micro, offset)
if obj:
- return value
+ return value
return format_datetime(value)