Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX S23 bad hour always 0 #124

Merged
merged 1 commit into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions primestg/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ def octet2date(txt):
hour = 0
else:
hour = hexadecimal and octet2number(hour_txt) or int(hour_txt)
if int(hour_txt) > 23:
hour = 0
minute_txt = txt[10:12]
if minute_txt == 'FF':
minute = 0
Expand Down
1 change: 1 addition & 0 deletions spec/utils_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
"21110021000000000W": datetime(2111, 1, 21, 0, 0, 0),
"00021130000000000W": datetime(2002, 11, 30, 0, 0, 0),
# wrong year
"3022002094010020FF800009": datetime(3022, 01, 20, 0, 1, 0),
"00001228230000000W": "time data '0-12-28 23:0:0' does not match format '%Y-%m-%d %H:%M:%S'",

}
Expand Down
Loading