Help with date handling


#1

Having a little difficulty with variables and the time functions. I have 2 variables set. And would like to check is $now is between them.
I.e.

Start_event: Wed, Nov 15 08:00 AM
END_event: Wed, Nov 22 09:00 AM

IF $now is between Start_event and End_event
Then return true
Else return false

The problem I am having is getting the start and end events to convert from a string format to a time format to compare them. If I use datetime it gives the current date Any suggestions


#2

Please follow the outline provided when submitting to this topic


#3

I’m sorry. What outline?


#4

There is a template when you create a topic in this category. You would of had to delete it to write your post.


#5

Ahh see it now sorry. Will have to do this later when I have a little more time. Thank you


#6

Why use variables?
Under Virtual Device you will find Time.
Select that and put and put in your times or under value select presets.
Just thought I’d post on here if it saves time.


#7

I’m using gcal search smart app to pull holidays from my google calendar. From that I can pull the start date and end date of the “event” to a variable. Then I can set an off set by x amount of days to auto change the color of my lights based on the holiday.

The event only show up as a single day, but to get the offset I need a. Variable.

I figured it out I will post the piston when I’m done.

Cheers