[JavaScript] Date time string to date

  • 0
str = "09-Apr-2010";
date = new Date(Date.parse(str.replace(/-/g, " ")));
alert(date.toLocaleString());
Reference: string-to-datetime-conversion-javascript
Javascript datetime string to Date object

沒有留言 :

張貼留言