1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-19 00:17:51 +02:00

fix 12 to 24 hour conversion for midnight cases

This commit is contained in:
Kelly Brazil
2021-03-24 15:04:39 -07:00
parent f62446c152
commit 6a6b26ed8d

View File

@ -142,6 +142,11 @@ def process(proc_data):
if proc_data['period']: if proc_data['period']:
if proc_data['period'].lower() == 'pm': if proc_data['period'].lower() == 'pm':
dt_hour_24 = dt_hour + 12 dt_hour_24 = dt_hour + 12
if dt_hour_24 > 23:
dt_hour_24 = 12
if proc_data['period'].lower() == 'am':
if dt_hour_24 == 12:
dt_hour_24 = 0
epoch_dt = datetime(dt_year, dt_month, dt_day, hour=dt_hour_24, minute=dt_minute, second=dt_second) epoch_dt = datetime(dt_year, dt_month, dt_day, hour=dt_hour_24, minute=dt_minute, second=dt_second)