I
I
Igor2016-07-21 11:50:40
JavaScript
Igor, 2016-07-21 11:50:40

How to get the client's native timezone?

let's say Moscow GMT 3
We need such a format for obtaining the user's date
//21.07.2016.10:56:17 GMT 3

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Belyaev, 2016-07-21
@IgorBee

var d = new Date();
console.log(d.getTimezoneOffset()); //смещение от Гринвича в минутах

G
GreatRash, 2016-07-21
@GreatRash

Date() // "Thu Jul 21 2016 12:04:34 GMT+0300 (RTZ 2 (зима))"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question