Parse DateTime string in JavaScript

前端 未结 9 2175
别跟我提以往
别跟我提以往 2020-11-22 12:15

Does anyone know how to parse date string in required format dd.mm.yyyy?

9条回答
  •  北海茫月
    2020-11-22 13:10

    refs: http://momentjs.com/docs/#/parsing/string/

    If you use moment.js, you can use "string" + "format" mode

    moment(String, String);
    moment(String, String, String);
    moment(String, String, Boolean);
    moment(String, String, String, Boolean);
    

    ex:

    moment("12-25-1995", "MM-DD-YYYY");
    

提交回复
热议问题