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

后端 未结 5 550
野的像风
野的像风 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

    Without a any external jQuery plugin like DateJs. We can get the date as given below.

    var datetime= '2010-10-18 10:06 AM' // Default datetime will be like this.
    
    //By Spliting the input control value with space
    var date=datetime.split(' ')[0];
    //date -2010-10-18
    

提交回复
热议问题