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

后端 未结 14 1516
小鲜肉
小鲜肉 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:18

    I would just use this small extension to Date - http://blog.stevenlevithan.com/archives/date-time-format

    var date = new Date(msSinceEpoch);
    date.format("isoDateTime"); // 2007-06-09T17:46:21
    

提交回复
热议问题