We help IT Professionals succeed at work.

Assign date format mmmm d, yyyy in code

Medium Priority
1,018 Views
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?
Thanks
Comment
Watch Question

Top Expert 2007
Commented:
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

Jim

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