'Search by date MODX REVO

How do I filter records by date?

I have the value 1639082700 which is equal to 2021-12-09 23:45:00. I need to find all data for 2021-12-09 which is equal to 1638997200.



Solution 1:[1]

You can use FROM_UNIXTIME() to convert integers to actual dates. For example:

SELECT * 
FROM modx_table 
WHERE FROM_UNIXTIME(column_name,'%Y-%m-%d') = '2021-12-09'

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Bram Verstraten