From cff714056a46ac07151efba5f48646213006b566 Mon Sep 17 00:00:00 2001 From: Kyle Ambroff Date: Wed, 27 Aug 2008 22:49:10 +0000 Subject: One-liner fix for indra.base.llsd.parse_datestr. Ensure that seconds are always 2 digits if there are no microseconds. Updated unit tests to enforce this. Reviewed by James. --- indra/lib/python/indra/base/llsd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/lib/python') diff --git a/indra/lib/python/indra/base/llsd.py b/indra/lib/python/indra/base/llsd.py index 8e71aee060..c841cdaf63 100644 --- a/indra/lib/python/indra/base/llsd.py +++ b/indra/lib/python/indra/base/llsd.py @@ -67,7 +67,7 @@ def format_datestr(v): seconds = v.second + float(v.microsecond) / 1000000 second_str = "%05.2f" % seconds else: - second_str = "%d" % v.second + second_str = "%02d" % v.second return '%s%sZ' % (v.strftime('%Y-%m-%dT%H:%M:'), second_str) -- cgit v1.2.3