C
C
Crash2018-04-16 07:21:27
Time Zones
Crash, 2018-04-16 07:21:27

How to unambiguously determine the time zone of a site visitor?

I am working on a project where it will be critical to take into account the time zones of visitors.
How can you uniquely identify them? Ask to specify your city through a special widget or calculate dynamically using JS?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2018-04-16
@Bandicoot

var offset = new Date().getTimezoneOffset();
console.log(offset);
dock and check
where it is critical
it is definitely better to ask for confirmation even after the determination.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question