I have a date being extracted from the database which is formatted as following
12/23/2005
Which is
mm/dd/yyyy
I want to convert it in classic asp to the following
December 23 2004
Could anyone help me with this?
Cheers,
I have a date being extracted from the database which is formatted as following
12/23/2005
Which is
mm/dd/yyyy
I want to convert it in classic asp to the following
December 23 2004
Could anyone help me with this?
Cheers,
You could try this:
Function FormatDate(input)
FormatDate = MonthName(Month(CDate(input))) & " " & Day(CDate(input)) & " " & Year(CDate(input))
End Function
Response.Write(FormatDate("12/23/2005"))
I'm assuming you want it to show "December 23 2005" if you want it to show "December 23 2004" then just subtract one from the Year() call:
FormatDate = MonthName(Month(CDate(input))) & " " & Day(CDate(input)) & " " & (Year(CDate(input))-1)
assuming you are doing this in c#
DateTime thisDate = new DateTime.Now;
String outString = thisDate.ToString("MMMM dd, yyyy");