Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I determine that the start of week is Monday or Sunday in different culture in C#

Tags:

c#

.net

some country use Monday as the first day in a week, some country use Sunday. in C#/.Net, the library Globalization can determine current webpage open in different country, but I didn't find any useful method for determine the which country use which day as start of week.

like image 935
lou mi Avatar asked Oct 14 '25 17:10

lou mi


1 Answers

Use this Globalized TimeFormat

 var firstDayOfWeek = CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek;
like image 112
VVN Avatar answered Oct 17 '25 06:10

VVN



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!