At this moment %z, %:z and %Z time format codes are replaced by empty strings (see Note 6), because of:
|
# A naive local datetime is fine here, because we only format it. |
|
return datetime.datetime.now() # noqa: DTZ005 |
Could you replace datetime.datetime.now() with datetime.datetime.now().astimezone()?
And, frankly, I disagree with the comment: I use aware time object here exactly because I format it (using %:z in my case).
Off-topic: thank you for attrs and structlog! And huuuge thanks for your articles—I've learned from your texts a lot.