#Development #Guides
The Intl API · “The best browser API you’re not using.” https://ilo.im/16c0ma
_____
#Formatters #DateTime #Numbers #Text #Internationalization #Browser #APIs #WebDev #Frontend #JavaScript
I'm writing Python and I'm not a Python person.
I have a need to get a Unix timestamp of a time that is an arbitrary number of days ago.
In PowerShell, you can do something like this:
PS > Get-Date -Date (Get-Date).AddDays(-30) -UFormat %s
In Python, this is the best I came up with and it is ugly:
import re
import datetime
`int(re.split('\\.',str((datetime.datetime.now(datetime.UTC) - datetime.timedelta(days=30)).timestamp()))[0])`
That was from me reading module documentation and hacking away at it for a bit.
Surely, there is a better way.
I'm interfacing with an API that only takes datetime in Unix Time format and only down to the second in precision.
Temporal: It's about time!
-- From State of the Browser 2026.
"After more than seven years of specification work, Temporal is finally here! In this talk, we’ll explore the history, the challenges, and the new API that’s set to replace JavaScript’s long-maligned Date object. You’ll learn how Temporal simplifies working with dates, times, time zones, and why it’s truly about time we had it."

[Перевод] Temporal: 9-летний путь к исправлению времени в JavaScript
Cтарший инженер-программист в организации JavaScript Infrastructure & Terminal Experience компании Bloomberg Джейсон Уильямс опубликовал пост, в котором рассказал, как он вместе с командой реализовывал библиотеку Temporal вместо Date для различных типов дат и времени. Автор выступает делегатом TC39 (группы экспертов из Ecma International, отвечающей за стандартизацию и развитие языка JavaScript) и имеет опыт стандартизации функций, реализации языка и участия в крупных проектах с открытым исходным кодом. Джейсон также является создателем движка Boa JavaScript.
https://habr.com/ru/articles/1009474/
#bloomberg_terminal #java #javascript #javascript_library #date #api #temporal #datetime #дата_и_время #библиотеки
How to Stop DateTime From Using the Wrong Timezone
Timezone defaults can flip comparisons in production.

This is the most horrific thing I have seen in a long time, and on the strength of that alone I am going to buy one of the author's books: https://mattgemmell.scot/books/once-upon-a-time/stories/the-calendar/
DateTime Timezone Shift Costs $2.3M In Missed Flights?!
TIMEZONE APOCALYPSE! Flight times stored WITHOUT timezone! UTC 14:00 displays as 2 PM but IS 11 AM local! 470 passengers MISSED flights in ONE day! Airlines lost $2.3M! Watch this disaster!
#sql #sqldisaster #timezone #datetime #productionbug #dataloss #sqlfails #airlinedisaster #sqlshorts #databasedisaster #sqlwtf #timestamphell
Get Current Date via 2 Methods
Get Current Date via 2 Methods This content explores interesting aspects of this topic. The information provided offers valuable insights and perspectives. Understanding this reveals how everyday things are more thoughtful than they appear. Next time you'll notice this detail. This fascinating detail shows how much thought goes into things we take for granted.
Можно ли заменить datetime? Как Pendulum делает работу с датой и временем удовольствием
Работа с датой и временем в программировании — это одна из тех «темных» областей, на которой каждый разработчик набивает свои шишки. На первый взгляд все просто: from datetime import datetime, datetime.now(). Что может пойти не так? А потом в проекте появляются часовые пояса, и начинается тихий ужас. Вы внезапно обнаруживаете, что стандартная библиотека Python оперирует двумя видами объектов: «наивными» (naive), которые ничего не знают о своем часовом поясе, и «осведомленными» (aware), у которых эта информация есть. И datetime.now() по умолчанию создает именно «наивный» объект, который в лучшем случае бесполезен, а в худшем — источник трудноуловимых багов, когда ваш код запускается на сервере в другом конце света.