|
Hi all hope someone out there can help me
This is my code...
Response.write FormatDateTime(Now,vbLongDate)
but what im getting is 10 January 2005 instead of Tuesday 10 January 2005
Any Ideas?
|
|
|
You can use a DateTime overload of the ToString() method to specify the format. The particular format you've requested is not one of the built-in formats, you'll have to build that yourself by calling the various methods (Day, Week, etc.) of the DateTime object.
If you want to use one of the built-in formats:
DateTime dt = DateTime.Now;
String date;
date = dt.ToString("D", DateTimeFormatInfo.InvariantInfo);
MSDN article: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDateTimeClassToStringTopic.asp
If you always want to format your date a certain way, you need to look at the "Locale" functions of the .NET platform.
Regards,
Thomas D. Greer
www.tgreer.com
If this post helped you, please keep in mind that CodeToad is advertiser supported, as is my personal site.
|
|
|
|
|
|
|
|
|
|