How convert PST Unix timestamp to UTC and then to any custom time zone (GMT+2, …) ?
Please provide solution in javascript or nodejs lib (momentjs)
How convert PST Unix timestamp to UTC and then to any custom time zone
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Unix timestamps are automatically in GMT, since they are defined as
number of seconds since 00:00 on 1st January 1970 GMT. You can create a date object from a timestamp vianew Date(timestamp)and you can then use the Date methods to format it. Simple math can be used to move between time zones by simply subtracting the number of hours difference.