Odd or even week numer

Free domotica! Forums Feature requests Odd or even week numer

This topic contains 1 reply, has 2 voices, and was last updated by  K.Rens 1 year, 11 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2075

    maggiymir
    Participant

    Is possible to add to Blockly Odd and even week numbers.
    So I can say If week is even then run one thing and if week is odd then run another thing.
    Maybe from Yahoo server.

    #2076

    K.Rens
    Keymaster

    You can use a custom php block.

      $weekNumber = date("W");
        if($weekNumber&1) { 
         $item=1;
       } else {
        $item=2;
       }

    You can then use the variable block inside blocky to see whether item is 1 or 2 (even or odd).
    I just don’t know whether 1 is odd or even, that you need to test 🙂

    Kind regards,
    K.Rens

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.