Is there some inbuilt function to return weekdayname based on value 1-7?
/M
System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.DayNames
more info
for integers from 1 to 7, you'll need to subtract 1 as the array is zero-indexed.
for(int i = 1; i < 8; i++)
{
Console.WriteLine(System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.DayNames[i-1]);
}
This will give localised weekday names based on the current culture.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With