getting the day name of the given date
-
how can i get the day name (sunday or monday or ..... etc) of the given date like 03/05/2007 ?? i want to know the day name of this date or any date in this format
-
how can i get the day name (sunday or monday or ..... etc) of the given date like 03/05/2007 ?? i want to know the day name of this date or any date in this format
System.Globalization.DateTimeFormatInfo.CurrentInfo.GetDayName(DateTime.Now.DayOfWeek); ... will give you the culture specific name of the current date.
-
System.Globalization.DateTimeFormatInfo.CurrentInfo.GetDayName(DateTime.Now.DayOfWeek); ... will give you the culture specific name of the current date.
Brady Kelly wrote:
will give you the culture specific name of the current date.
He asked for a given date, not the current date DateTime dt = DateTime.Parse("03/05/2007"); System.Globalization.DateTimeFormatInfo.CurrentInfo.GetDayName(dt.DayOfWeek)
only two letters away from being an asset
-
Brady Kelly wrote:
will give you the culture specific name of the current date.
He asked for a given date, not the current date DateTime dt = DateTime.Parse("03/05/2007"); System.Globalization.DateTimeFormatInfo.CurrentInfo.GetDayName(dt.DayOfWeek)
only two letters away from being an asset
Yes, but I assumed his requirement was to find the name, not parse a date, and at least gave him credit for being able to apply the example to any date.