Akkana Peck on Nostr: In datetime hell again. I just hate #Python's datetime SO much. Any given datetime ...
In datetime hell again. I just hate #Python's datetime SO much. Any given datetime object might or might not have a timezone. Any given function might or might not return a timezone-aware datetime. If you ever mess up and call a function that returns a timezone when you didn't expect one, or vice versa, or a function you call changes in that respect, now you have a hidden time bomb that will crash your program the next time you do a comparison with or subtraction from another datetime.
Published at
2026-02-20 19:25:13 UTCEvent JSON
{
"id": "2e140f15152cb597c08e82d772aad713912d806a0e903c8d5917381c48e61ae8",
"pubkey": "b29259428568d1d6cc4567df23ea40f3c489577bccf080d0bb18d74ec46a7ae8",
"created_at": 1771615513,
"kind": 1,
"tags": [
[
"t",
"python"
],
[
"proxy",
"https://fosstodon.org/users/akkana/statuses/116104594320407898",
"activitypub"
],
[
"client",
"Mostr",
"31990:6be38f8c63df7dbf84db7ec4a6e6fbbd8d19dca3b980efad18585c46f04b26f9:mostr",
"wss://relay.ditto.pub"
]
],
"content": "In datetime hell again. I just hate #Python's datetime SO much. Any given datetime object might or might not have a timezone. Any given function might or might not return a timezone-aware datetime. If you ever mess up and call a function that returns a timezone when you didn't expect one, or vice versa, or a function you call changes in that respect, now you have a hidden time bomb that will crash your program the next time you do a comparison with or subtraction from another datetime.",
"sig": "b19d7e406b98b0094f8b152e32e7a89ff575362c04598f00a082462c697e5dd6a5e7895d1bcbaf47bb1193272ba62cf52ed440bc4e2c908ffc91ca5071e31d93"
}