2015-07-28 | Paul Boddie | raw files shortlog changelog graph | Expose UTC usage in datetimes through TZID attributes, preventing misinterpretation and subsequent misrepresentation in the manager interface. | |
imiptools/data.py (file) |
1.1 --- a/imiptools/data.py Mon Jul 27 23:44:05 2015 +0200 1.2 +++ b/imiptools/data.py Tue Jul 28 00:07:06 2015 +0200 1.3 @@ -366,7 +366,10 @@ 1.4 return None 1.5 else: 1.6 value, attr = t 1.7 - return get_datetime(value, attr), attr 1.8 + dt = get_datetime(value, attr) 1.9 + if dt.tzname() == "UTC": 1.10 + attr["TZID"] = "UTC" 1.11 + return dt, attr 1.12 1.13 # Conversion functions. 1.14