Search code examples
javascriptdatedate-format

Extract Month or Day or Year from Timestamp


I would like to know how to get a specific date format (date or month or day or year) from a timestamp. I am wanting to use this in a view with Backbone JS


Solution

  • var d = new Date(1397639141184);
    alert(d.getDate() + '/' + (d.getMonth()+1) + '/' + d.getFullYear());