D369: util: add `hgdatetopython` to convert hg-style dates to datetimes

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Tue Aug 15 13:06:57 EDT 2017


durin42 added inline comments.

INLINE COMMENTS

> util.py:1862
> +def hgdatetopython(date):
> +    """Returns a Python datetime from a Mercurial tuple-style date"""
> +    t, tz = date

This function makes me really nervous, because it's a naive datetime rather than a tz-aware datetime. Could we do better about preserving the exact point-in-time value of the tz-aware time information?

("no" is a possible answer here, but I'd really like to know why we're not storing the zone offset in the datetime object.)

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D369

To: phillco, #hg-reviewers
Cc: durin42, lothiraldan, mercurial-devel


More information about the Mercurial-devel mailing list