Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / .NET SDK / April 2005

Tip: Looking for answers? Try searching our database.

Date formatting

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
KDV - 04 Apr 2005 16:15 GMT
I am using the the date format string "dddd, MMMM dd, yyyy" which formats
Date  type to Monday, April 04, 2005. Is there any way I can specify in the
format string so that the day should be in capital letter eg MONDAY, April
04, 2005. I don't want to parse myself.

Thanks in advance
Katy King - 04 Apr 2005 22:28 GMT
| From: =?Utf-8?B?S0RW?= <kdv@discussions.microsoft.com>
|
| I am using the the date format string "dddd, MMMM dd, yyyy" which formats
| Date  type to Monday, April 04, 2005. Is there any way I can specify in the
| format string so that the day should be in capital letter eg MONDAY, April
| 04, 2005. I don't want to parse myself.

You can define your own array of day names, and format with it:

       DateTimeFormatInfo dtfi = new DateTimeFormatInfo();
       dtfi.DayNames = new String[] { "SUNDAY", "MONDAY", "TUESDAY",
               "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY",  };
       Console.WriteLine(dt.ToString("dddd, MMMM dd, yyyy", dtfi));

Parsing should already be case-insensitive.

Katy
CLR Testing
KDV - 05 Apr 2005 16:35 GMT
Thanks Karty. Actually in my application I was storing only the date format
string which was controlling how the date will be formatted. With this
approach I don't have to store only the date mask but also additional info
like whether to display Days/Months in uppercase or lowercase.( 24 entries
for the month JAN/JANUARY
and 14 for the Days SUN/SUNDAY). I think this is the way it gonna work.

Thanks for the reply

> | From: =?Utf-8?B?S0RW?= <kdv@discussions.microsoft.com>
> |
[quoted text clipped - 16 lines]
> Katy
> CLR Testing

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.