myusuf3 / delorean

Delorean: Time Travel Made Easy
http://delorean.rtfd.org/
MIT License
1.84k stars 128 forks source link

end_of_day does not handle leap seconds #65

Open mlew opened 9 years ago

mlew commented 9 years ago

Leap seconds occaisonally get added to days to account for the Earth's slowing rotation. The end_of_day function should be aware of days that contain leap seconds, and return the proper value accordingly.

>>> d = Delorean(datetime(2015, 6, 30), timezone='US/Pacific')
>>> d.end_of_day()
datetime.datetime(2015, 6, 30, 23, 59, 60, 999999, tzinfo=<DstTzInfo 'US/Pacific' PDT-1 day, 17:00:00 DST>)