From: Tony Mack Date: Mon, 26 Dec 2011 04:42:51 +0000 (-0500) Subject: utcparse now supports longs X-Git-Tag: sfa-2.0-7~13^2~1 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=3a505b548e71164faf35925d726b62199f6507c2;p=sfa.git utcparse now supports longs --- diff --git a/sfa/util/sfatime.py b/sfa/util/sfatime.py index 473056e2..d2699f47 100644 --- a/sfa/util/sfatime.py +++ b/sfa/util/sfatime.py @@ -22,7 +22,7 @@ For safety this can also handle inputs that are either timestamps, or datetimes if t.utcoffset() is not None: t = t.utcoffset() + t.replace(tzinfo=None) return t - elif isinstance (input, (int,float)): + elif isinstance (input, (int,float,long)): return datetime.datetime.fromtimestamp(input) else: logger.error("Unexpected type in utcparse [%s]"%type(input))