What is the “right” JSON date format?

前端 未结 16 1390
执念已碎
执念已碎 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 16:08

    The prefered way is using 2018-04-23T18:25:43.511Z...

    The picture below shows why this is the prefered way:

    JSON Date

    So as you see Date has a native Method toJSON, which return in this format and can be easily converted to Date again...

提交回复
热议问题