Do Indians and Americans see the same Date.now value?
When it comes to Date.now in JavaScript, the value returned represents the number of milliseconds elapsed since January 1, 1970 UTC. This means that Date.now should theoretically return the same value for everyone around the world who calls it at the exact same time.
So, if an Indian and an American run Date.now at the same time, they should see the same value returned. This is because Date.now is based on the Coordinated Universal Time (UTC), which is the same for everyone regardless of their timezone.
However, it’s important to note that the actual time displayed to users will be different based on their local timezone settings. Date.now simply returns the number of milliseconds since 1970 UTC, which can be converted to the appropriate local time based on the user’s timezone.
In conclusion, Indians and Americans (and people from all around the world) should see the same value returned when they run Date.now at the same time, as long as their devices are synchronized and there are no delays in the execution of the code.
I think it should give same
it's a good question, I thought Unix Epoch shows the milliseconds depended on your local date, but after reading the comment, UTC makes more sense
UTC everywhere
Thank you but I’d rather have an answer to the last question…
What does chatgtp say?
I expect it to be the same regardless of timezone requested.
Add me on LinkedIn. I need friends.
https://www.linkedin.com/in/nateazevedo/