metomi/isodatetime

Inconsistence in time zone values returned by dumpers.TimePointDumper.get_time_zone()

kinow opened this issue · 1 comments

kinow commented

In dumpers.TimePointDumper, get_time_zone returns a time zone tuple for a given string. So +01:00 will return a tuple with two strings ('01', '00').

While writing unit tests to cover some parts of the TimePointDumper, I realized my input values test matrix looked a bit weird. Here's the values used as input, with their equivalent returned values.

input (string) output (tuple or None) notes
'+01:00' ('01', '00') string, string
'+00:00' ('00', '00') string, string
'-00:00' (0, 0) int, int
'-03:00' (-3, 0) negative int, int
'-03:30' (-3, -30) negative int, negative int (maybe sign just hours?)
'Z' (0, 0) int, int

I believe this is not breaking anything (at least I couldn't find anything in the existing issues), but it makes harder for users to use the values returned. I think consistency here would ease the use, and also reduce the chance of bugs.

Not a blocker for next release I think... and probably not a blocker for moving to Python 3, so just creating the issue for now 👍

Cheers
Bruno