It's possible I'm missing something here, but it seems like Delorean doesn't handle fractional seconds correctly in the next_second/last_second methods:
In [115]: dt
Out[115]: datetime.datetime(2015, 1, 1, 0, 0)
In [116]: d = Delorean(dt, timezone='utc')
In [117]: d.next_second(0.5).datetime
Out[117]: datetime.datetime(2015, 1, 1, 0, 0, tzinfo=<UTC>)
In [118]: _.microsecond
Out[118]: 0
In [119]: dt + relativedelta(seconds=0.5)
Out[119]: datetime.datetime(2015, 1, 1, 0, 0, 0, 500000)
Fractional days do seem to work:
In [124]: d.next_day(0.7390)
Out[124]: Delorean(datetime=2015-01-01 17:44:09.600000+00:00, timezone=utc)
BTW, really enjoying the package so far, it's made the code I've been writing an order of magnitude better.
It's possible I'm missing something here, but it seems like Delorean doesn't handle fractional seconds correctly in the
next_second
/last_second
methods:Fractional days do seem to work:
BTW, really enjoying the package so far, it's made the code I've been writing an order of magnitude better.