I would like compare the two dates to get a time (Days, Hours, minutes and seconds) difference in TWIG
{% set todayDate = ( \"now\"| date(\"Y-m-d H:i:s\") )
Finally i got it.. compare the two dates to get a time (Days, Hours and minutes) in controller :
(doctrine query)
TIMESTAMPDIFF(DAY,CURRENT_TIMESTAMP(), a.enddate) AS endday,
(TIMESTAMPDIFF(HOUR,CURRENT_TIMESTAMP(), a.enddate) - TIMESTAMPDIFF(DAY,CURRENT_TIMESTAMP(),a.enddate)*24) AS endhour,
(TIMESTAMPDIFF(MINUTE,CURRENT_TIMESTAMP(), a.enddate) - TIMESTAMPDIFF(HOUR,CURRENT_TIMESTAMP(), a.enddate)*60) AS endmin,
Created a function for TIMESTAMPDIFF https://github.com/beberlei/DoctrineExtensions/blob/master/lib/DoctrineExtensions/Query/Mysql/TimestampDiff.php
and include a snippet
app->config->config.yml doctrine: dbal: ........
orm:
entity_managers:
default:
auto_mapping: true
dql:
datetime_functions:
timestampdiff: Acme\BUNDLE\FOLDER\TimestampDiff
Thanks to all ..