diff options
author | Ryan Williams <rdw@lindenlab.com> | 2008-10-10 19:57:34 +0000 |
---|---|---|
committer | Ryan Williams <rdw@lindenlab.com> | 2008-10-10 19:57:34 +0000 |
commit | 635c06bb46b5e6a3f53f48167a06576c63f8aa5f (patch) | |
tree | 8288809c5f94d3a5893c03fb600e5099d6b1cbc3 /indra/lib/python | |
parent | 591382f613cdfc330ec78af577bd1783a101e2d0 (diff) |
DEV-22018 : cllsd unit test failures. Fixed mostly by changing the Python code and the tests to look more like cllsd.
Diffstat (limited to 'indra/lib/python')
-rw-r--r-- | indra/lib/python/indra/base/llsd.py | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/indra/lib/python/indra/base/llsd.py b/indra/lib/python/indra/base/llsd.py index 17ab89004a..5b8f5d7613 100644 --- a/indra/lib/python/indra/base/llsd.py +++ b/indra/lib/python/indra/base/llsd.py @@ -47,7 +47,7 @@ alpha_regex = re.compile(r"[a-zA-Z]+") date_regex = re.compile(r"(?P<year>\d{4})-(?P<month>\d{2})-(?P<day>\d{2})T" r"(?P<hour>\d{2}):(?P<minute>\d{2}):(?P<second>\d{2})" r"(?P<second_float>(\.\d+)?)Z") -#date: d"YYYY-MM-DDTHH:MM:SS.FFZ" +#date: d"YYYY-MM-DDTHH:MM:SS.FFFFFFZ" class LLSDParseError(Exception): pass @@ -69,14 +69,7 @@ BOOL_FALSE = ('0', '0.0', 'false', '') def format_datestr(v): """ Formats a datetime object into the string format shared by xml and notation serializations.""" - second_str = "" - if v.microsecond > 0: - seconds = v.second + float(v.microsecond) / 1e6 - second_str = "%05.2f" % seconds - else: - second_str = "%02d" % v.second - return '%s%sZ' % (v.strftime('%Y-%m-%dT%H:%M:'), second_str) - + return v.isoformat() + 'Z' def parse_datestr(datestr): """Parses a datetime object from the string format shared by xml and notation serializations.""" |