Beispiel #1
0
    def test_should_build_utc_epoch_milliseconds_using_timezone_aware_datetime(self):

        # Both should generate the same row key
        utc_now = datetime.utcnow()
        local_now = datetime.now(tz=pytz.timezone('US/Eastern'))

        dto = TimestampedDataDTO('test', local_now, 'd', '0')
        unix_time_millis = dto.timestamp_as_unix_time_millis()

        print unix_time_millis
Beispiel #2
0
    def test_should_build_utc_epoch_milliseconds_using_timezone_aware_datetime(
            self):

        # Both should generate the same row key
        utc_now = datetime.utcnow()
        local_now = datetime.now(tz=pytz.timezone('US/Eastern'))

        dto = TimestampedDataDTO('test', local_now, 'd', '0')
        unix_time_millis = dto.timestamp_as_unix_time_millis()

        print unix_time_millis