how do you format a date into the format 30-Apr-10 in javascript?
+4
A:
There are a few libraries out there for this, you can use something like Date Format (under 4kb completely uncompressed), then your usage would be like this:
var currentDateString = new Date().format("dd-mmm-yy");
Though, if possible, I'd stick to 4-digit years :)
Nick Craver
2010-04-25 12:08:13
If using ASP.NET AJAX a format function is available: http://msdn.microsoft.com/nb-no/library/bb310850.aspx
knut
2010-04-25 12:26:26