Merge pull request #5 from rackspace/python26

datetime works with python2.6
This commit is contained in:
Sandy Walsh 2012-11-02 08:48:24 -07:00
commit 693f7d56ce

View File

@ -5,9 +5,10 @@ import time
def dt_to_decimal(utc):
decimal.getcontext().prec = 6
return decimal.Decimal(calendar.timegm(utc.utctimetuple()) +
utc.microsecond/float(1e6))
decimal.getcontext().prec = 30
return decimal.Decimal(str(calendar.timegm(utc.utctimetuple()))) + \
(decimal.Decimal(str(utc.microsecond)) /
decimal.Decimal("1000000.0"))
def dt_from_decimal(dec):