Date between x and y

Désolé, cet article est seulement disponible en Anglais Américain. Pour le confort de l’utilisateur, le contenu est affiché ci-dessous dans une autre langue. Vous pouvez cliquer le lien pour changer de langue active.

Hereby an example that explains how you can trigger blocky rules only when the current date is between 2 days:

blockly_date_between

The php code used inside the block, so you can copy paste it:

$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){
	$datebetween=true;
}else{
	$datebetween=false;
}

If you want to do it between 2 timestamps instead,
there is inside blocky under “Utils” the option “Time =”.
If you click on the = sign you can change it to “between”.
This allows you to put “Time between”.