Skip to content

Commit

Permalink
fix: ods: use duration for time value as per specification
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalfree committed Jul 10, 2024
1 parent bf53c0f commit e2391a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tablib/formats/_ods.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def convert_date(val):
return convert_date(date_value)
if value_type == 'time':
time_value = cell.getAttribute('timevalue')
return dt.datetime.strptime(time_value, "%H:%M:%S").time()
return dt.datetime.strptime(time_value, "PT%HH%MM%SS").time()
if value_type == 'boolean':
bool_value = cell.getAttribute('booleanvalue')
return bool_value == 'true'
Expand Down Expand Up @@ -163,7 +163,7 @@ def dset_sheet(cls, dataset, ws):
elif isinstance(col, dt.date):
cell = table.TableCell(valuetype="date", datevalue=col.strftime('%Y-%m-%d'))
elif isinstance(col, dt.time):
cell = table.TableCell(valuetype="time", timevalue=col.strftime('%H:%M:%S'))
cell = table.TableCell(valuetype="time", timevalue=col.strftime('PT%HH%MM%SS'))
elif col is None:
cell = table.TableCell(valuetype="void")
else:
Expand Down

0 comments on commit e2391a6

Please sign in to comment.