Пример #1
0
def test_date_to_timestamp():
    assert TimeStampType.date_to_timestamp(EPOCH) == 0

    ts = TimeStampType.date_to_timestamp(datetime(2014, 5, 8, 22, 40, 40, tzinfo=tzutc()))
    assert ts == 1399588840.0

    ts = TimeStampType.date_to_timestamp(
        datetime(2014, 5, 8, 22, 40, 40, tzinfo=gettz('PST8PDT')))
    assert ts == 1399614040.0
Пример #2
0
def test_date_to_timestamp():
    assert TimeStampType.date_to_timestamp(EPOCH) == 0

    ts = TimeStampType.date_to_timestamp(
        datetime(2014, 5, 8, 22, 40, 40, tzinfo=tzutc()))
    assert ts == 1399588840.0

    ts = TimeStampType.date_to_timestamp(
        datetime(2014, 5, 8, 22, 40, 40, tzinfo=gettz('PST8PDT')))
    assert ts == 1399614040.0