dear all i want to convert a string to dateformate var string=2007-07-31 00:00:00.000 the ouput should be like this 31/7/2007 Can anyone help me to resolve this issue.
var dateStr = "2007-07-31 00:00:00.000"; dateStr = dateStr.replace(/(\d{4})-(\d{2})-(\d{2}).+/,"$3/$2/$1") alert(dateStr); Code (markup):