nokia / git-changelog-generator

Git Changelog Generator
https://pypi.python.org/pypi/gcg
BSD 3-Clause "New" or "Revised" License
14 stars 5 forks source link

Check and implement proper timezone manipulations #4

Closed weakcamel closed 5 years ago

weakcamel commented 6 years ago

See FIXME items

https://github.com/nokia/git-changelog-generator/blob/b08973433ab6971301fdf713df1a578ea75a459f/gcg/entrypoint.py#L208

https://github.com/nokia/git-changelog-generator/blob/b08973433ab6971301fdf713df1a578ea75a459f/gcg/entrypoint.py#L224

neechbear commented 6 years ago

https://gitpython.readthedocs.io/en/stable/reference.html#module-git.objects.commit

From the looks of the docs, it's stored as seconds since UTC epoch, so maybe you can just bung the value through pytz to transform it to alternate timezones?

Wouldn't we just want to output as the local timezone though?

weakcamel commented 6 years ago

Output at local timezone - yes, absolutely. The input (commits, tags) may be coming from any timezone and I have this sinking feeling that I'm handling it wrong, especially for DEB :)

weakcamel commented 6 years ago

https://julien.danjou.info/python-and-timezones/

I'll have a look also whether pytz helps here or can this be done purely with standard library; the data we get for timezone is "UTC offset in seconds", not actual timezone.

felfert commented 5 years ago

I have looked at several rpm spec files from redhat. None of them shows timezones in the changelog. Not even time, only dates. So: At least for rpm format, this is not needed. I also looked at changelog on an Ubuntu 18.04 machine and with that one, time zonees are shown as tz-offsets (no names needed). Should be pretty easy to implement.

weakcamel commented 5 years ago

Thanks for checking. For RPMs it's less of an issue yet I was thinking about the case when with tagging and actual build happening in different timezones, different zone might mean a different day. RPM changelog should IMO show local date then (which may in rare cases be different than the tagger's date).