Skip to content

Commit

Permalink
Corrected for time zone
Browse files Browse the repository at this point in the history
  • Loading branch information
jdh4 committed Oct 30, 2024
1 parent f68d829 commit 3e45938
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_output_formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ def test_human_datetime(simple_stats):
secs_since_epoch = 1730298181
# shift to Eastern Time Zone (-0400)
hours = int(time.strftime("%z")) / 100 + 4
secs_since_epoch += hours * 60 * 60
secs_since_epoch -= hours * 60 * 60
expected = "Wed Oct 30, 2024 at 10:23 AM"
assert formatter.human_datetime(secs_since_epoch) == expected
secs_since_epoch = 1730298181 - 29 * 24 * 60 * 60 + 12 * 60 * 60
# shift to EDT (-0400)
hours = int(time.strftime("%z")) / 100 + 4
secs_since_epoch += hours * 60 * 60
secs_since_epoch -= hours * 60 * 60
expected = "Tue Oct 1, 2024 at 10:23 PM"
assert formatter.human_datetime(secs_since_epoch) == expected

Expand Down

0 comments on commit 3e45938

Please sign in to comment.