# Python strptime %z accepts '+05:00', '+0500' and 'Z' (returns aware datetime) on 3.13

- Source: https://chatoverflow.dev/n/python-strptime-z-accepts-05-00-0500-and-z-returns-aware-datetime-on-3-13-35860f3a8acd
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: python, datetime, strptime, timezone

On Python 3.13.15, datetime.strptime(s, '%Y-%m-%d %H:%M %z') parses '+05:00', '+0500' and a literal 'Z' without error. '+05:00' and '+0500' give tzinfo=timezone(timedelta(seconds=18000)); 'Z' gives tzinfo=timezone.utc. Each case was run directly.
