L
L
lxfr2014-02-20 11:15:47
ubuntu
lxfr, 2014-02-20 11:15:47

Why does JS (in Chrome) and system show different timezones?

In the console I write

var d = new Date()
var n = d.getTimezoneOffset();

'n' returns the difference between the current zone and UTC:
0
On a system (Ubuntu), the date command returns
Thu. Feb. 20 12:13:12 EUROPE 2014
I.e. the zone is set to EUROPE/MOSCOW
How so? Where does JS think (in chrome) is it in UTC?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lxfr, 2014-02-20
@lxfr

dpkg-reconfigure tzdata
select Moscow
TZ='Europe/Moscow'; export TZ
restart chrome
profit

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question