added 2 commits
September 4, 2019 16:01(cherry-picked from c6dd3d7 . I've included the refactoring mentioned in python-telegram-bot#1497 to facilitate the change.) There was inconsistent use of UTC vs local times. For instance, in the former `_timestamp` helper (now `_datetime_to_float_timestamp`), assumed that naive `datetime.datetime` objects were in the local timezone, while the `from_timestamp` helper —which I would have thought was the corresponding inverse function— returned naïve objects in UTC. This meant that, for instance, `telegram.Message` objects' `date` field was constructed as a naïve `datetime.datetime` (from the timestamp sent by Telegram's server) in *UTC*, but when it was stored in `JSON` format through the `to_json` method, the naïve `date` would be assumed to be in *local time*, thus generating a different timestamp from the one it was built from. See python-telegram-bot#1505 for extended discussion.
A job shouldn't (and can't) be enqueued with `next_t = None`. An exception should be raised at `_put` before an obscure error occurs later down the line.