# Test cases for ISO-8601/RFC-3339 date, time, and datetime parsing # I haven't quite figured out how to specify timezones. The UTC, # UTC_M8 arguments to dt() are pseudo-code placeholders at this point. dt = datetime.datetime cases = [ # From RFC-3339, section 5.8 ("1985-04-12T23:20:50.52Z", dt(1985, 4, 12, 23, 20, 50, 520000, UTC)), ("1996-12-19T16:39:57-08:00", dt(1996, 12, 19, 16, 39, 57, 0, UTC_M8)), ("1996-12-19T16:39:57-08:00", dt(1996, 12, 20, 0, 39, 57, 0, UTC)), ("1990-12-31T23:59:60Z", dt(1990, 12, 31, 23, 59, 60, 0, UTC)), ("1990-12-31T15:59:60-08:00", dt(1990, 12, 31, 23, 59, 60, 0, UTC)), # From Henry Precheur's rfc3339.py module # (http://henry.precheur.org/python/rfc3339) ("2008-04-02T20:00:00Z", dt(2008, 4, 2, 20, 0, 0, 0, UTC)), ("1970-01-01T00:00:00Z", dt.fromtimestamp(0)), ]