Convert day today to int?

I want Convert day today to int.

Example : If today = Monday
I want output int = 1.

Now I use Convert.ToInt32(DateTime.Now.DayOfWeek)
But output show 0 as below.

Please guide me about it.

1 Like

Hey @fairymemay

Yes it shows like the below,

0 - Sunday
1 - Monday
2 - Tuesday
3 - Wednesday
4 - Thursday
5 - Friday
6 - Saturday

I guess when you ran the above code, as per your system day it would be Sunday that’s why it outputs as 0

Hope this helps


1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.