src/Kunstmaan/NodeBundle/EventListener/FixDateListener.php
public function onKernelResponse(FilterResponseEvent $event)
    {
        $response = $event->getResponse();
        if ($response) {
            $date = $response->getDate();
            if (empty($date)) {
                $response->setDate(new \DateTime());
            }
        }
    }
public function onKernelResponse(FilterResponseEvent $event)
    {
        $response = $event->getResponse();
        if ($response) {
            $date = $response->getDate();
            if (empty($date)) {
                $response->setDate(new \DateTime());
            }
        }
    }
public function onKernelResponse ( FilterResponseEvent $ event ) { $ response = $ event -> getResponse ( ) ; if ( $ response ) { $ date = $ response -> getDate ( ) ; if ( empty ( $ date ) ) { $ response -> setDate ( new \ DateTime ( ) ) ; } } }
Make sure response has a timestamp

@param FilterResponseEvent|GetResponseEvent $event
Make sure response has a timestamp