jquery function to convert datetime, split date time “2010-10-18 10:06” to return “18/10/2010” and “10:06”

后端 未结 5 542
野的像风
野的像风 2020-12-19 06:42

Hi I was wondering if there is any jquery function around which can take this dateTime \"2010-10-18 10:06\" and convert and split it returning \"2010/10/18\" and \"10:06\".<

5条回答
  •  借酒劲吻你
    2020-12-19 07:06

    Converting with DateJs should be as easy as:

    var d1 = Date.parse('2010-10-18, 10:06 AM');
    alert(d1.toString('dd/mm/yyyy HH:mm:ss GMT'));
    

    It's currently the best library around

提交回复
热议问题