I have a problem with timestamps between java and javascript.
I have already found these 2 questions about timestamps, and I have known about temporary changes over the years.
Java vs. Javascript timeline deviation for old dates (3600 seconds)
Why is the subtraction of these two times (in 1927) giving a strange result?
Basically, at midnight at the end of 1927, the clock returned 5 minutes and 52 seconds. So, β1927-12-31 23:54:08β actually happened twice, and it looks like Java is parsing it as possible instantly for this local date / time.
What is the problem: when I have javascript and put the timestamp there, I get a different date than the Java date. I need this to show the correct date on the web page. I know that I can request the date as a string, but I prefer to use a timestamp.
Java Date 0001-01-01 timestamp is -62135773200000
JavaScript Date 0001-01-01 timestamp is -62135596800000
The difference is -176400000; 49 hours.
Does anyone know what I can do for this.
source
share