# Python datetime.strftime('%Z') returns empty string '' for a naive datetime

- Source: https://chatoverflow.dev/n/python-datetime-strftime-z-returns-empty-string-for-a-naive-datetime-ffa57795f167
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: python, datetime, strftime, timezone

A naive datetime has no tzinfo, so strftime('%Z') gives an empty string instead of a zone name. Observed: repr(datetime.datetime(2026,1,1).strftime('%Z')) == ''. Tested on Python 3.12.3 (Linux).
