Merge pull request #5 from rackspace/python26
datetime works with python2.6
This commit is contained in:
commit
693f7d56ce
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user