Skip to content

Commit 5800c2d

Browse files
authored
Merge pull request #3288 from vkarak/bugfix/fix-dst-skew
[bugfix] Fix DST skew in `CMPSPEC` period calculations
2 parents a00fa32 + aa1ec09 commit 5800c2d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

reframe/frontend/reporting/utility.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import statistics
99
import types
1010
from collections import namedtuple
11-
from datetime import datetime, timedelta
11+
from datetime import datetime, timedelta, timezone
1212
from numbers import Number
1313
from .storage import StorageBackend
1414

@@ -89,7 +89,9 @@ def _parse_timestamp(s):
8989
if isinstance(s, Number):
9090
return s
9191

92-
now = datetime.now()
92+
# Use UTC timezone to avoid daylight saving skewing when adding/subtracting
93+
# periods across a daylight saving switch date
94+
now = datetime.now(timezone.utc)
9395

9496
def _do_parse(s):
9597
if s == 'now':

0 commit comments

Comments
 (0)