Answer the question
In order to leave comments, you need to log in
How to select infoblock elements by date greater than a certain one?
Good day.
There is an infoblock, there are elements, I needed to parse the elements for the current day
$arSelect = Array("ID", "NAME", "DATE_ACTIVE_FROM", "DATE_CREATE");
$arFilter = Array("IBLOCK_ID"=>16, "PROPERTY_ID_VK" => "", "ACTIVE" => "Y", ">=DATE_ACTIVE_FROM" => date("Y-m-d")." 00:00:00");
$res = CIBlockElement::GetList(Array(), $arFilter, false, Array("nPageSize"=>100), $arSelect);
while($ob = $res->GetNextElement())
{
$arFields = $ob->GetFields();
?><pre><?print_r($arFields)?></pre><?
Answer the question
In order to leave comments, you need to log in
// чтобы получить дату в формате сайта (в битриксе)
$date = date('Y-m-d');
$timestamp = MakeTimeStamp($date, 'YYYY-MM-DD');
$convertDateTime = ConvertTimeStamp($timestamp);
$arFilter = Array("IBLOCK_ID"=>16, "PROPERTY_ID_VK" => false, "ACTIVE" => "Y", ">=DATE_ACTIVE_FROM" => $convertDateTime);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question