1

I have a date as "Thursday, 4 Aug 2011". How do I format it to "yyyy/MM/dd"? I have tried the codes:

var myDate =   dateText.toString("yyyy/MM/dd");
myDate = Date.parseExact(myDate, "yyyy/MM/dd")

but none seem to work. Help please.

learning
  • 11,415
  • 35
  • 87
  • 154
  • See http://stackoverflow.com/questions/986657/how-do-i-format-a-javascript-date – JJJ Aug 11 '11 at 11:06

2 Answers2

1

you may use datejs

thecodeparadox
  • 86,271
  • 21
  • 138
  • 164
0

here is a post on the subject : http://blog.stevenlevithan.com/archives/date-time-format

you also have this jquery plugin : http://plugins.jquery.com/project/jquery-dateFormat

Jerome Cance
  • 8,103
  • 12
  • 53
  • 106