Convert datetime formate dd/mm/yyyy 12:14 to dd/july/yyyy using javascript -
i want convert date time dd/july/yyyy
using javascript. have variable
var v = 29/09/2015 12:00
and want convert 29-july-2015
.
i assume var in quotes.
// note js months 0 based var month = ["january","february","march","april","may","june","july","august","september","october","november","december"]; function conv(str) { var dateparts = str.split(" ")[0].split("/"); return dateparts[0]+"-"+month[dateparts[1]-1]+"-"+dateparts[2]; } alert(conv("29/09/2015 12:00"));
Comments
Post a Comment