I find it difficult to convert a string representation of non-UTC time to UTC due to the shortening of the time zone paragraph.
(update: it seems that time zone abbreviations may not be unique . If so, maybe I should also consider this. )
I am trying to find a way around this using datetutil and pytz, but no luck.
Suggestions or workarounds are welcome.
string = "Jun 20, 4:00PM EDT"
I would like to convert this to UTC, while taking into account the daily savings.
UPDATE: Find some links that may help more experienced users answer question Q.
In fact, I would have imagined part of a solution doing the other side of this .
FINAL UPDATE (IMPORTANT)
Adapted from dateutil docs examples .
Some simple examples based on the date command, using the TZOFFSET dictionary to provide BRST timeline offset.
parse ("Thu Sep 25 10:36:28 BRST 2003", tzinfos = TZOFFSETS) datetime.datetime (2003, 9, 25, 10, 36, 28, tzinfo = tzoffset ('BRST', -10800))
parse ("2003 10:36:28 BRST 25 Sep Thu", tzinfos = TZOFFSETS) datetime.datetime (2003, 9, 25, 10, 36, 28, tzinfo = tzoffset ('BRST', -10800))
Combine this with a library, for example, found here. and you will have a solution to this problem.