On MariaDB 10, I'm trying to work with dates, particularly whether the current date is within 7 days of a date stored in the database. A longtext column holds an Epoch datetime, which I convert into a date-only using
FROM_UNIXTIME(t2.meta_value, '%d/%m/%Y'), and it returns nicely like 11/03/2019 (UK time formatting). But if I try to use it in datediff using a second parameter like now(), datediff returns NULL - and PHPMyAdmin shows a
#1292 incorrect datetime value. I've additionally tried adding
str_to_date without any remedy, and plenty of reading through Stackoverflow and internet articles.
FROM_UNIXTIME(column, '%d/%m/%Y') returns 11/03/2019 datediff(date_format(now(), '%d/%m/%Y'),FROM_UNIXTIME(column, '%d/%m/%Y'))
returns NULL, whether I use date_format or not.
I've also tried moving the code to the where clause, but this returns a #1292 error as well :
WHERE FROM_UNIXTIME(t2.meta_value, '%d/%m/%Y') > curdate()