When calling JSON.stringify to convert the object into the corresponding string, if it contains a time object, the time object will be converted to national standard time (ISO) instead of the time of the current country and region. The test code is as follows:
If you want JSON.stringify to convert the date object Date and return the time zone of the current country instead of the international standard time, you can override the toJSON method of the prototype of the Date object to return a custom time format, because JSON.stringify calls Date The toJSON method of the object, the example is as follows: