Answer the question
In order to leave comments, you need to log in
Why does the date in Angular get 3 hours late?
I am writing tests in Angular 13 using Jest.
At the very beginning, in describe('', () => {}) I create a field for the date
Next, after .compileComponents(), I write the date in the defaultDate field and then immediately display it in the console
let defaultDate: Date;
defaultDate = new Date(2021, 1, 1, 0, 0, 0);
console.log('default date is', defaultDate);
2021-01-31T21:00:00.000Z
. Mon Feb 01 2021 00:00:00 GMT+0300 (Москва, стандартное время)
Answer the question
In order to leave comments, you need to log in
2021-01-31T21:00:00.000Z
Z is Greenwich Mean Time.
Mon Feb 01 2021 00:00:00 GMT+0300
GMT+3 is in Moscow.
The time is the same, but the output is in different formats.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question