A
A
Artem Gribkov2016-02-24 19:20:51
1C-Bitrix
Artem Gribkov, 2016-02-24 19:20:51

How to get records for a specific date?

Actually, I need to get the number of records for a certain date, for example, for today: 02/24/2016
As soon as I didn’t try, it doesn’t work, now I’m trying like this:

$count_today = CIBlockElement::GetList([], [
    'IBLOCK_ID' => 12,
    '>=DATE_ACTIVE_FROM' => '24.02.2016 00:00:00',
    '<=DATE_ACTIVE_FROM' => '24.02.2016 00:00:00'
], [], false, []);

What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem Gribkov, 2016-02-24
@L1Qu0R

I solved the issue by adding to the filter:

">=DATE_CREATE" => date('d.m.Y H:i:s', mktime(0,0,0,date('m'),date("d"),date("Y"))),
"<=DATE_CREATE" => date('d.m.Y H:i:s', mktime(0,0,0,date('m'),date("d")+1,date("Y"))),

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question