2

Does anyone know how to convert "Date().getTime()" to UTC?

Obviously the getTime() is the users local time so I need a function to get the users timezone, convert the timestamp to UTC so I can then * it by -8 to get the current PST time.

1 Answer 1

2

Date.getTimezoneOffset()

as seen here. It returns the user's browser time relative to GMT, which you'll compare to your server time, relative to GMT.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.