Greetings. I need to translate the variable from string to date. Below is the code itself ...
$arFilter = array("ID" => 16104); $arSelect = array('NAME', 'PROPERTY_PAR_ID', 'PROPERTY_P_DATE', 'PROPERTY_P_NUMBER', 'PROPERTY_P_GIVER', 'PROPERTY_PAR_ID', 'PROPERTY_STATUS', 'ID', 'DATE_ACTIVE_FROM', 'DATE_ACTIVE_TO', 'DATE_CREATE', 'PROPERTY_DATE_IN', 'PROPERTY_DATE_OUT', 'PROPERTY_TYPE', 'PROPERTY_AUTHOR', 'PROPERTY_RESP_USER', 'PROPERTY_P_IS_ONETIME'); $res = CIBlockElement::GetList(Array(), $arFilter, false, false, $arSelect); $res = $res->Fetch(); $canget = true; if($res['DATE_ACTIVE_TO'] < date('dmY H:i')) { $canget = false; }else{}; echo gettype(date($res['DATE_ACTIVE_TO'])); echo "\n"; echo date('dmY H:i'); I get the following output:
string 11/14/2017 11:08
Please tell me what you need to write? I tried the option from the article How to convert a string to a php date? Unfortunately on my version, he did not work for some reason ....
echo $res['DATE_ACTIVE_TO']- splash58