Odd or even week numer

Domotica gratuit Forums Feature requests Odd or even week numer

2 sujets de 1 à 2 (sur un total de 2)
  • Auteur
  • #2075

    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.

    Maître des clés

    You can use a custom php block.

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

    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,

2 sujets de 1 à 2 (sur un total de 2)
  • Vous devez être connecté pour répondre à ce sujet.