N
N
Nikita Baev2016-02-17 08:39:21
JavaScript
Nikita Baev, 2016-02-17 08:39:21

How to solve the problem with UNIX time on different axes?

When called (as well as new Date()) - on Windows machines it will return the 19th number, on *nix → 20th number (which is correct). How can you get the same result everywhere?
moment(580064400000).date()

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Ulanov, 2016-02-17
@antonsr98

time synchronization by means of ntp?

G
GreatRash, 2016-02-17
@GreatRash

Chota, I don’t understand what’s going on at all :) I decided to try it in the console:

Date(580064400000); // "Wed Feb 17 2016 11:16:02 GMT+0300 (RTZ 2 (зима))"
new Date(580064400000); // Thu May 19 1988 20:00:00 GMT+0300 (RTZ 2 (зима))

UPD: And understood, there stupidly .toString() is called.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question