-4

How to make a format like this in javascript, using Date function:

Jun 23, 2010 12:00 AM
Hello
  • 2,247
  • 4
  • 23
  • 29
  • 7
    Please have a look at the right part of this page entitled "Related" – zerkms Apr 29 '13 at 03:42
  • Related and/or duplicates: http://stackoverflow.com/questions/15151902/javascript-equivalent-for-vbscript-now-and-time/15152044#15152044 http://stackoverflow.com/questions/605971/formatting-the-date-in-javascript?rq=1 http://stackoverflow.com/questions/1056728/formatting-a-date-in-javascript?rq=1 – SomeShinyObject Apr 29 '13 at 03:43

1 Answers1

0

http://jsfiddle.net/tqwEE/

var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];

var date = new Date();

console.log(months[date.getMonth()] + " " + date.getDate() + ", " + (date.getYear()+1900) + " " + date.getHours() + ":" + date.getMinutes());

//Example Output: Apr 28, 2013 20:47
KingKongFrog
  • 13,946
  • 21
  • 75
  • 124