TIME _CasOdLoc TIME _CasDoLoc IF _Interval = 1 THEN ; Aktuálna smena _CasOdLoc := %SubTime(%NextTime(3600*8, 3600*6, 0), 8*3600) _CasDoLoc := %NextTime(3600*8, 3600*6, 0) ELSIF _Interval = 2 THEN ; Minulá smena IF Hour >= 6 & Hour < 14 THEN ;Ranná smena _CasOdLoc := %NextTime(24*3600, -(2+24)*3600, 0) _CasDoLoc := %NextTime(24*3600, -18*3600, 0) ELSIF Hour >= 14 & Hour < 22 THEN ;Popoludnajšia smena _CasOdLoc := %NextTime(24*3600, -18*3600, 0) _CasDoLoc := %NextTime(24*3600, -10*3600, 0) ELSIF Hour >= 22 | Hour < 6 THEN ;Nočná smena _CasOdLoc := %NextTime(24*3600, -10*3600, 0) _CasDoLoc := %NextTime(24*3600, -2*3600, 0) ENDIF ELSIF _Interval = 3 THEN ; Dnes IF Hour < 6 THEN _CasOdLoc := %NextTime(3600*24, -3600*24*2+3600*6, 0) _CasDoLoc := %NextTime(3600*24, -3600*24+3600*6, 0) ELSE _CasOdLoc := %NextTime(3600*24, -3600*24+3600*6, 0) _CasDoLoc := %NextTime(3600*24, 3600*6, 0) ENDIF ELSIF _Interval = 4 THEN ; Včera IF Hour < 6 THEN _CasOdLoc := %NextTime(3600*24, -3600*24*3+3600*6, 0) _CasDoLoc := %NextTime(3600*24, -3600*24*2+3600*6, 0) ELSE _CasOdLoc := %NextTime(3600*24, -3600*24*2+3600*6, 0) _CasDoLoc := %NextTime(3600*24, -3600*24+3600*6, 0) ENDIF ELSIF _Interval = 5 THEN ; Tento týždeň _CasOdLoc := %NextTime(3600*24, -WeekDay*24*3600+6*3600, 0) _CasDoLoc := %NextTime(3600*24, (7-WeekDay)*24*3600+6*3600, 0) ELSIF _Interval = 6 THEN ; Minuly tyzden _CasOdLoc := %NextTime(3600*24, (-WeekDay-7)*24*3600+6*3600, 0) _CasDoLoc := %NextTime(3600*24, (-WeekDay-1)*24*3600+6*3600, 0) ELSIF _Interval = 7 THEN ; Tento mesiac _sTime := %TimeToStr(SysTime, "06:00:00 01-mm-rrrr") _eTime := %TimeToStr(SysTime, "06:00:00 01-"+ %IToStr(Month + 1) +"-rrrr") _CasOdLoc := %StrToTime(_sTime) _CasDoLoc := %StrToTime(_eTime) ELSIF _Interval = 8 THEN ; Minuly mesiac _sTime := %TimeToStr(SysTime, "06:00:00 01-"+ %IToStr(Month - 1) +"-rrrr") _eTime := %TimeToStr(SysTime, "06:00:00 01-mm-rrrr") _CasOdLoc := %StrToTime(_sTime) _CasDoLoc := %StrToTime(_eTime) ENDIF
Súvisiace stránky:
Pridať komentár