DateTime::__construct(): Failed to parse time string I want to get the lates postDate of a List and format it for the cache tag

{% set latestSubmission = craft.amForms.submissions(
    { formHandle: 'reservation', order: 'dateCreated desc' }).datum('&gt;= '~now).dateCreated().first()
%}

{{ latestSubmission }}


This Returns: 


  Do., 07 Sep. 2017 10:32:05


But I want to pass it into the Cache Tag so I want to format it and write:

{{ latestSubmission | date('c') }}

This returns the error:


  DateTime::__construct(): Failed to parse time string (Do., 07 Sep. 2017 10:32:05) at position 0 (D): The timezone could not be found in the database


Why? Why can’t I reformat it when it is already returning a date?
You're getting that error because Do., 07 Sep. 2017 10:32:05 isn't in a valid PHP Date/Time format when you pass it into the |date filter.

Changing it to 07 Sep. 2017 10:32:05 should work.