Sometimes we may need to have the day names in a week for a given culture. With ASP.NET CultureInfo class you can loop through the DateTimeFormat.DayNames and get them. Here is the example of it
using System.Globalization;
CultureInfo ci = new CultureInfo("ar-ae");
// gets the day names of arabic, arab emirates
foreach (string day in ci.DateTimeFormat.DayNames)
Response.Write(day + " ");
Depending on the culture you want, you can get the CultureInfo reference for that corresponding culture. The DateTimeFormat also provides other values like month names, first day of week etc.,
Good Luck
Monday, August 11, 2008
Subscribe to:
Post Comments (Atom)


No comments:
Post a Comment