I can’t find a solution to this:
I only want to compare two date and timestamps with eachother like this ->
{if $CONFIG.ENDDATE lte $smarty.now|date_format:"%Y%m%d %H:%M"}
$CONFIG.ENDDATE and $smarty.now are Strings (Like this: string(14) "20231218 16:02"). Unfortunately, it doesn’t work the way I imagined it would. Does anyone have any ideas or tips?
I tried it with this Post Compare two dates in smarty
but this does not work with timestamps. If I only use this:
{if $CONFIG.ENDDATE lte $smarty.now|date_format:"%Y%m%d"}
and only compare dates, then everything works as it should.
2
Answers
I've solved the problem like this:
Instead of string, you must change
$CONFIG.ENDDATE
to timestamp.you can try this, it will work: