Добавить
Уведомления

How do I get a value of datetime.today() in Python that is "timezone aware"?

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn -- Music by Eric Matyas https://www.soundimage.org Track title: Puzzling Curiosities -- Chapters 00:00 Question 00:58 Accepted answer (Score 481) 02:36 Answer 2 (Score 180) 02:55 Answer 3 (Score 161) 04:23 Answer 4 (Score 41) 04:53 Thank you -- Full question https://stackoverflow.com/questions/4530069/how-do-i-get-a-value-of-datetime-today-in-python-that-is-timezone-aware Accepted answer links: [zoneinfo]: https://docs.python.org/3/library/zoneinfo.html [pytz library]: http://pytz.sourceforge.net/ [pytz documentation]: https://pythonhosted.org/pytz/ [What Every Developer Should Know About Time]: http://web.archive.org/web/20160803154621/http://www.windward.net/blogs/every-developer-know-time/ [The Problem with Time & Timezones - Computerphile]: https://www.youtube.com/watch? Answer 2 links: [pytz]: https://pypi.org/project/pytz/ Answer 3 links: [astimezone]: https://docs.python.org/3/library/datetime.html#datetime.datetime.astimezone [jfs' answer]: https://stackoverflow.com/a/25421145/247696 [zoneinfo]: https://docs.python.org/3/library/zoneinfo.html [tzdata]: https://pypi.org/project/tzdata/ Answer 4 links: [astimezone]: https://docs.python.org/3/library/datetime.html#datetime.datetime.astimezone [suggested by johnchen902]: https://stackoverflow.com/questions/4530069/python-how-to-get-a-value-of-datetime-today-that-is-timezone-aware/4905978 #comment77694396_4530069 -- Content licensed under CC BY-SA https://meta.stackexchange.com/help/licensing -- Tags #python #datetime #date #timezone #avk47

12+
17 просмотров
2 года назад
12+
17 просмотров
2 года назад

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn -- Music by Eric Matyas https://www.soundimage.org Track title: Puzzling Curiosities -- Chapters 00:00 Question 00:58 Accepted answer (Score 481) 02:36 Answer 2 (Score 180) 02:55 Answer 3 (Score 161) 04:23 Answer 4 (Score 41) 04:53 Thank you -- Full question https://stackoverflow.com/questions/4530069/how-do-i-get-a-value-of-datetime-today-in-python-that-is-timezone-aware Accepted answer links: [zoneinfo]: https://docs.python.org/3/library/zoneinfo.html [pytz library]: http://pytz.sourceforge.net/ [pytz documentation]: https://pythonhosted.org/pytz/ [What Every Developer Should Know About Time]: http://web.archive.org/web/20160803154621/http://www.windward.net/blogs/every-developer-know-time/ [The Problem with Time & Timezones - Computerphile]: https://www.youtube.com/watch? Answer 2 links: [pytz]: https://pypi.org/project/pytz/ Answer 3 links: [astimezone]: https://docs.python.org/3/library/datetime.html#datetime.datetime.astimezone [jfs' answer]: https://stackoverflow.com/a/25421145/247696 [zoneinfo]: https://docs.python.org/3/library/zoneinfo.html [tzdata]: https://pypi.org/project/tzdata/ Answer 4 links: [astimezone]: https://docs.python.org/3/library/datetime.html#datetime.datetime.astimezone [suggested by johnchen902]: https://stackoverflow.com/questions/4530069/python-how-to-get-a-value-of-datetime-today-that-is-timezone-aware/4905978 #comment77694396_4530069 -- Content licensed under CC BY-SA https://meta.stackexchange.com/help/licensing -- Tags #python #datetime #date #timezone #avk47

, чтобы оставлять комментарии