How can I convert string to datetime with format specification in JavaScript?

前端 未结 15 1230
终归单人心
终归单人心 2020-11-22 02:35

How can I convert a string to a date time object in javascript by specifying a format string?

I am looking for something like:

var dateTime = convert         


        
15条回答
  •  一个人的身影
    2020-11-22 03:09

    Just for an updated answer here, there's a good js lib at http://www.datejs.com/

    Datejs is an open source JavaScript Date library for parsing, formatting and processing.

提交回复
热议问题