Community discussions

 
gotsprings
Forum Veteran
Forum Veteran
Topic Author
Posts: 778
Joined: Mon May 14, 2012 9:30 pm

Time range test

Wed Jun 06, 2018 2:42 pm

I need a script to check the current time and then take action based on time.

I.E. If time is between 00:00:00-009:00:00 do
else

So this was my first guess.
:local timetest [/system clock get time]
:log info $timetest

:if ($timetest = 00:00:00-09:00:00) do={
    :log info TooEarly
} else= {
    :log info Late
}
I see the time output in the log like I should. But I think I have the wrong thing in the = to parameter.
Right now its 07:42:00 which shows in the log but the output reads "Late."

Sure its a syntax thing. Any help would be great.
"It ain't what you don't know that gets you into trouble. It's what you know for sure that just ain't so."
Mark Twain
 
User avatar
dasiu
Trainer
Trainer
Posts: 232
Joined: Fri Jan 30, 2009 11:41 am
Location: Reading, UK
Contact:

Re: Time range test  [SOLVED]

Wed Jun 06, 2018 3:04 pm

if (($timetest>00:00:00) and ($timetest<09:00:00)) do={...
 
gotsprings
Forum Veteran
Forum Veteran
Topic Author
Posts: 778
Joined: Mon May 14, 2012 9:30 pm

Re: Time range test

Wed Jun 06, 2018 3:06 pm

Perfect! Thanks.
"It ain't what you don't know that gets you into trouble. It's what you know for sure that just ain't so."
Mark Twain

Who is online

Users browsing this forum: No registered users and 13 guests