Skip to content

Commit c8c74c2

Browse files
committed
[ExecuteTime] isoformat function is missing from notebook's tz for v<5
aaaaaargh
1 parent 0eece6c commit c8c74c2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/jupyter_contrib_nbextensions/nbconvert_support/execute_time.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ def run_cell(self, cell, cell_index, *args, **kwargs):
3131
ets['start_time'] = exec_reply['metadata']['started']
3232
else:
3333
# attempt to fallback to datetime obj for execution request msg
34-
ets['start_time'] = nbtz.isoformat(
35-
exec_reply.get('parent_header', {}).get('date', before))
36-
ets['end_time'] = nbtz.isoformat(
37-
exec_reply.get('header', {}).get('date') or nbtz.utcnow())
34+
ets['start_time'] = exec_reply.get(
35+
'parent_header', {}).get('date', before).isoformat()
36+
ets['end_time'] = (
37+
exec_reply.get('header', {}).get('date') or nbtz.utcnow()
38+
).isoformat()
3839

3940
return exec_reply, outs

0 commit comments

Comments
 (0)