def date_util_test(): """ Simple test of correctly transforming a timestamp to a python datetime, and back to a timestamp """ # test a not-very-random sequence of times for ts in range(0, 1250000000, 321321): # simply see if we can round-trip the timestamp and get the same result dt = dt_from_timestamp(ts) ts2 = int(dt_to_timestamp(dt)) assert ts2 == ts
def _get_time_display(self): t = dt_from_timestamp(self.trans_date, tz=Eastern).strftime("%H:%M:%S") return t
def _get_date_display(self): return dt_from_timestamp(self.trans_date, tz=Eastern).strftime("%m/%d/%Y")