What is the “right” JSON date format?

前端 未结 16 1593
执念已碎
执念已碎 2020-11-21 15:14

I\'ve seen so many different standards for the JSON date format:

\"\\\"\\\\/Date(1335205592410)\\\\/\\\"\"         .NET JavaScriptSerializer
\"\\\"\\\\/Date(         


        
16条回答
  •  没有蜡笔的小新
    2020-11-21 15:48

    When in doubt simply go to the javascript web console of a modern browser by pressing F12 (Ctrl+Shift+K in Firefox) and write the following:

    new Date().toISOString()
    

    Will output:

    "2019-07-04T13:33:03.969Z"

    Ta-da!!

提交回复
热议问题