datetime - day of week and hour of day in a if statement c# -
i want if day, , time of day equal true in if statement. have day part down, can't figure out time part out. let wan time 9am.
here have far
var dt_check_monday = datetime.now.dayofweek; if (dt_check_monday == dayofweek.monday && time_now = datetime.now.hour==9) { //do }
i can't use error:
operator '&&' cannot applied operands of type 'bool' , 'system.timespan'
thanks in advance.
i think time_now
having timespan
datatype. can try this
if (dt_check_monday == dayofweek.monday && time_now.hours == 9) { //do }
Comments
Post a Comment