-1

I have this code:

int intDay = DateTime.Now.DayOfWeek;

But that's not working.

Is there a way that I can get an integer value for the day of the week?

Alan2
  • 23,493
  • 79
  • 256
  • 450

1 Answers1

1

You need to cast it, as with any other enum:

int intDay = (int)DateTime.Now.DayOfWeek;
Johnathan Barclay
  • 18,599
  • 1
  • 22
  • 35