We help IT Professionals succeed at work.

Assign date format mmmm d, yyyy in code

Medium Priority
Last Modified: 2013-11-26
The AJAX CalendarExtender places January 17, 2008 in the test box on the screen using
Format="MMMM d, yyyy"  in at aspx file
I use ToLongDateString in the .vb file and get
I need Friday, January 18, 2008
What date format do I use to get the format January 17, 2008?
Watch Question

Top Expert 2007
You just supply the format to the ToString() metod of the DateTime object you are working with as:
formatString = "MMMM d, yyyy"
formattedDate = myDateTime.ToString( formatString);

"dddd, MMMM d, yyyy" ==> Friday, January 18, 2008
"MMMM d, yyyy"           ==> January 18, 2008


Explore More ContentExplore courses, solutions, and other research materials related to this topic.