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
  • 10,935
  • 33
  • 85
  • 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
  • 84,459
  • 21
  • 136
  • 161
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
  • 7,975
  • 11
  • 51
  • 105