コード例 #1
0
    def test_parse_datetime_format1(self):
        self.assertEqual(utilities.parse_datetime_format1("2012-11-12 01:00:03-08"),
                         datetime(2012, 11, 12, 9, 0, 3, tzinfo=tzutc()))
        
        self.assertEqual(utilities.parse_datetime_format1("2012-12-12 23:00:03-05"),
                         datetime(2012, 12, 13, 4, 0, 3, tzinfo=tzutc()))

        self.assertEqual(utilities.parse_datetime_format1("2012-12-12 23:00:03-00"),
                         datetime(2012, 12, 12, 23, 0, 3, tzinfo=tzutc()))
コード例 #2
0
    def test_parse_datetime_format1(self):
        self.assertEqual(
            utilities.parse_datetime_format1("2012-11-12 01:00:03-08"),
            datetime(2012, 11, 12, 9, 0, 3, tzinfo=tzutc()))

        self.assertEqual(
            utilities.parse_datetime_format1("2012-12-12 23:00:03-05"),
            datetime(2012, 12, 13, 4, 0, 3, tzinfo=tzutc()))

        self.assertEqual(
            utilities.parse_datetime_format1("2012-12-12 23:00:03-00"),
            datetime(2012, 12, 12, 23, 0, 3, tzinfo=tzutc()))
コード例 #3
0
ファイル: flighthistory.py プロジェクト: Jsalim/GEFlightQuest
def to_utc_date(myString):
    if not myString or myString=="MISSING":
        return "MISSING"
    if myString=="HIDDEN":
        return "HIDDEN"
    return utilities.parse_datetime_format1(myString).astimezone(tz.tzutc())
コード例 #4
0
def to_utc_date(myString):
    if not myString or myString == "MISSING":
        return "MISSING"
    if myString == "HIDDEN":
        return "HIDDEN"
    return utilities.parse_datetime_format1(myString).astimezone(tz.tzutc())