K
K
krispeyJAk2022-03-15 12:34:06
1C-Bitrix
krispeyJAk, 2022-03-15 12:34:06

Bitrix how to display a getlist of records that are more than 1 day old? 1 year?

There is a table:
62305d3e0daea174897604.png
and a getlist:

$rsTransacts = \transaction::getList([
    'select' => [
        'USER_ID', 'DATE_CREATE', 'VALUE', 'DEBIT'
    ],
    'filter' => [
        'DATE_CREATE' => 
    ]
]);

How to correctly write a condition in DATE_CREATE to display posts for topics whose date_create is greater than 1 day from the current date? 1 year?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Livach, 2022-03-15
@krispeyJAk

You calculate the date from which you want to count, for example, through DateTime , using the relative format .
And substitute in the condition:

'filter' => [
        '>DATE_CREATE' => "2021.11.26 00:00:00",
    ]

Here is a link to the documentation .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question