From 635c06bb46b5e6a3f53f48167a06576c63f8aa5f Mon Sep 17 00:00:00 2001
From: Ryan Williams <rdw@lindenlab.com>
Date: Fri, 10 Oct 2008 19:57:34 +0000
Subject: [PATCH] DEV-22018 : cllsd unit test failures.  Fixed mostly by
 changing the Python code and the tests to look more like cllsd.

---
 indra/lib/python/indra/base/llsd.py | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/indra/lib/python/indra/base/llsd.py b/indra/lib/python/indra/base/llsd.py
index 17ab89004a0..5b8f5d7613b 100644
--- a/indra/lib/python/indra/base/llsd.py
+++ b/indra/lib/python/indra/base/llsd.py
@@ -47,7 +47,7 @@
 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 @@ class uri(str):
 
 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."""
-- 
GitLab