I am trying to check server date and time to compate with date TV of resource, but i always get blank page when I try to check in IF statment, here is what i need.
I have snippet like this
<?php
function getDatetimeNow() {
$tz_object = new DateTimeZone('Europe/Belgrade');
$datetime = new DateTime();
$datetime->setTimezone($tz_object);
return $datetime->format('Y\-m\-d\ h:i:s');
}
$currentDate = getDatetimeNow();
$dtA = new DateTime($currentDate);
$dtB = new DateTime($date);
if ( $dtA > $dtB ) {
$active = 0;
return $active;
}
else {
$active = 1;
return $active;
}
But when on page if i try like this
[[!CheckCurrentDate? &date=`[[*DatumIsteka]]`]]
I got 1 or 0 based on TV value *DatumIsteka, all is working ok, but when i try to compare like this
[[!If?
&subject=`[[!CheckCurrentDate? &date=`[[*DatumIsteka]]`]]`
&operator=`equals`
&operand=`0`
&then=`<script>
$("#tab3").html("<p>U Pripremi</p>");
</script>`
]]
I got white page of resource?? What can be the problem, any help will be nice :)