formatTime/Long can handle timestamp

Also replaced *_time with *_ts wherever possible.
This commit is contained in:
Tomas Kopecek 2020-08-17 13:13:05 +02:00
parent b0efed5e37
commit 7855b98ca2
16 changed files with 39 additions and 22 deletions

View file

@ -100,4 +100,17 @@ class TestFormatTime(unittest.TestCase):
r = formatTimeLong(d3)
self.assertEqual(r, desired)
# timestamps, local timezone
d4 = 0
desired = 'Thu, 01 Jan 1970 01:00:00 CET'
r = formatTimeLong(d4)
self.assertEqual(r, desired)
# timestamps, GMT
desired = 'Thu, 01 Jan 1970 00:00:00 GMT'
os.environ['TZ'] = 'GMT'
time.tzset()
r = formatTimeLong(d4)
self.assertEqual(r, desired)
locale.resetlocale()