How do I output an ISO 8601 formatted string in JavaScript?

后端 未结 14 1512
小鲜肉
小鲜肉 2020-11-22 08:41

I have a Date object. How do I render the title portion of the following snippet?



        
14条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-22 09:21

    If you don't need to support IE7, the following is a great, concise hack:

    JSON.parse(JSON.stringify(new Date()))
    

提交回复
热议问题