Date between day 1 and day 2: Example

Free domotica! Forums How can I …? Blocky examples Date between day 1 and day 2: Example

This topic contains 0 replies, has 1 voice, and was last updated by  djandib 2 years ago.

Viewing 1 post (of 1 total)
  • Author
  • #4195


    Maybe you need to define a timeperiod for using it in other scenes.
    For TIME between you can use the Blocky. But there isn`t a blocky for DATE between.

    We work with 3 variables and a free PHP-Blocky (you find it in the “Util” folder inside Blocky)
    We need:
    – Startdate
    – Enddate
    – summer (name of the variable

    phpcode for PHP-Blocky:
    $startTime = strtotime($startdate); $endTime = strtotime($enddate);
    $startFormat = date(‘Y-m-d’,$startTime); $endFormat=date(‘Y-m-d’, $endTime);
    if(date(‘Y-m-d’) >= $startFormat && date(‘Y-m-d’) <= $endFormat){

    After this we can use the variable for making request at it:

    Scene Summer


Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.