def test_parse_cdftt2000(): input_time = 131415926535793238 x = cdfepoch.encode(input_time) assert x == "2004-03-01T12:24:22.351793238" parsed = cdfepoch.parse(x) assert parsed == input_time assert cdfepoch().to_datetime(parsed) == [datetime(2004, 3, 1, 12, 24, 22, 351793)]
def test_parse_cdfepoch16(): input_time = 53467976543.0 + 543218654100j x = cdfepoch.encode(input_time) assert x == "1694-05-01T07:42:23.543218654100" parsed = cdfepoch.parse(x) assert parsed == input_time assert cdfepoch().to_datetime(parsed) == [datetime(1694, 5, 1, 7, 42, 23, 543218)]