What's the difference between datetime in ISO 8601 and UTC formats in javascript?

前端 未结 3 707
终归单人心
终归单人心 2021-01-31 03:02

I pick some date and time in javascript and then want to store it on server (.NET). Dates are supposed to be in future from the current moment (so they won\'t be before 1970). H

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-31 03:28

    I hope it will helpful to you.

    Summary About toISOString() :-

    The toISOString() method returns a string in ISO format (ISO 8601 Extended Format), which can be described as follows: YYYY-MM-DDTHH:mm:ss.sssZ. The timezone is always UTC as denoted by the suffix "Z".

    Refer Below link for more information about toISOString().

    Date.prototype.toISOString()

    Summary About toUTCString() :-

    The toUTCString() method converts a date to a string, using the UTC time zone.

    Refer Below link for more information about toUTCString()

    Date.prototype.toUTCString()

提交回复
热议问题