2 ms·
From the article: "Let's consider an example: suppose I want to record the moment I make a payment with my card. Many people might be tempted to do something l
by Javiliano 2y ago
From the article:
"Let's consider an example: suppose I want to record the moment I make a payment with my card. Many people might be tempted to do something like this:
const paymentDate = new Date('2024-07-20T10:30:00');".
What? I don't think anybody would define a date like this to record some moment. Most developers would simply use new Date() without any parameters, thereby creating a timezone-safe absolute underlying timestamp value. This value then is of course stringified relative to the timezone of the caller when retrieving it, but that's expected.
The new Temporal api might be nice but it doesn't need flawed examples to make its case.
- deleted 2y ago[deleted]
- Y_Y 2y agoUnless the payment already happened?