The difference between the output time of the console and the display time of the page is 8 hours.

the angularjs pipeline uses a 24-hour time system, but the console output is different from the page display. How to solve this problem?

lastStopTime | date: "yyyy/MM/dd HH:mm:ss"

Aug.30,2021

the output with a difference of 8 hours uses ISO format time because this is how the ISO format is defined.

const d = new Date();
console.log(d) // 
console.log(d.toISOString()) // 8

refer to DatePipe

the default locale locale is en-US,. Try setting it to zh-Hans.


solved: the console output format is a string format, not a time format;
two solutions:
first: directly intercept the string into the desired format;
second: the database saves the field into a timestamp format

Menu