1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
//월화수목금토일 public static int WeekDay(DateTime dateTime) { int tempWeekDay = 0; var dt = dateTime.DayOfWeek; switch (dt) { case DayOfWeek.Monday: //월 tempWeekDay=1; break; case DayOfWeek.Tuesday: //화 tempWeekDay=2; break; case DayOfWeek.Wednesday: //수 tempWeekDay=3; break; case DayOfWeek.Thursday: //목 tempWeekDay=4; break; case DayOfWeek.Friday: //금 tempWeekDay=5; break; case DayOfWeek.Saturday: //토 tempWeekDay = 6; break; case DayOfWeek.Sunday: //일 tempWeekDay = 7; break; } return tempWeekDay; } |