How do I check for the day of the week.
I want to check if it's a week day?
if date.dayofweek >=1 and date.dayofweek <=5 then dosomething
Public Structure RtcTime
dim Second As Byte ' Second (0..59)
dim Minute As Byte ' Minute (0..59)
dim Hour As Byte ' Hour (0..11 or 0..23)
End Structure
dim time as RtcTime
dim Starthour, Startmin, Stophour, Stopmin as byte
Sub Main()
time.hour = 2
time.Minute = 34
starthour = 1
startmin = 2
stophour = 3
stopmin = 45
if (((time.hour >= Starthour) and (time.minute >= Startmin)) and ((time.hour < Stophour) and (time.minute < Stopmin))) then
high(PORTB.0)
end if
If time.hour >= Starthour and time.hour < Stophour then
If time.minute >= Startmin and time.minute < Stopmin then
high(PORTB.0)
end if
end if
End Sub
Users browsing this forum: No registered users and 2 guests