Skip to content

Commit 4c1a6c6

Browse files
committed
Improves parser code
1 parent 12ea1a2 commit 4c1a6c6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

pendulum/parsing/parser.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,10 +375,8 @@ def _parse_iso8601(self, text):
375375
'hour': dt.hour,
376376
'minute': dt.minute,
377377
'second': dt.second,
378-
'subsecond': dt.microsecond
378+
'subsecond': dt.microsecond,
379+
'offset': dt.tzinfo.offset if dt.tzinfo else None
379380
}
380381

381-
if dt.tzinfo is not None:
382-
parsed['offset'] = dt.utcoffset().total_seconds()
383-
384382
return parsed

0 commit comments

Comments
 (0)