lingo.lol is one of the many independent Mastodon servers you can use to participate in the fediverse.
A place for linguists, philologists, and other lovers of languages.

Server stats:

66
active users

#datetime

0 posts0 participants0 posts today

Are there "names" for the different date time notations like
US: month, day, year
Europe: day, month, year
US: 12 hr with AM/PM
Other places : 24 hrs
Iso standard
Etc?

If there are names for these different notations maybe we could add them as Python enums and use the enum instead of constructing our own "%m %d %Y" whatever.

Wouldn't that be interesting? Might solve lots of bugs with wrong datetime format. 🤔

Hoje eu aprendi a converter um #datetimestamp unix em uma data legível com #Python #datetime

from datetime import datetime
ts = int('1284101485')

# if you encounter a "year is out of range" error the timestamp
# may be in milliseconds, try `ts /= 1000` in that case
print(datetime.utcfromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S'))

stackoverflow.com/a/3682808/19

Stack OverflowConverting unix timestamp string to readable dateI have a string representing a unix timestamp (i.e. "1284101485") in Python, and I'd like to convert it to a readable date. When I use time.strftime, I get a TypeError: >>>import...

Is it possible to get a zoneinfo.ZoneInfo key (i.e.: IANA tzdb identifier) for the current system timezone, in Python? `datetime.now(timezone.utc).astimezone().` gives a potentially ambiguous 'tzname' and 'utcoffset' which make it difficult to communicate long-term time intervals to other systems