is there an easy way to get the unix timestamp in javascript from a specific timezone? for example i want the client send me an unix timestamp but i want to get it to match my timezone.
thanks!
is there an easy way to get the unix timestamp in javascript from a specific timezone? for example i want the client send me an unix timestamp but i want to get it to match my timezone.
thanks!
In order for this to happen, you need to apply the timezone offset to the time, and then remove your offset from value (test this, I am guessing from memory):
Now offset from your own:
Why not simply send the date in UTC, and then convert to your timezone on the server?
Use
toISOString
to get a UTC timestamp.