Answers.Body: <p>You're getting that error because <code>Do., 07 Sep. 2017 10:32:05</code> isn't in a valid PHP <a href="https://secure.php.net/manual/en/datetime.formats.php" rel="nofollow noreferrer">Date/Time format</a> when you pass it into the <code>|date</code> filter.</p>
  
  <p>Changing it to <code>07 Sep. 2017 10:32:05</code> should work.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-11T09:08:58.460Z
Answers.Text: But that means the `latestSubmission` tag which gets it's data from the am forms plugin saves the date in the wrong formate in the db? since there is no manipulaiton on my side ??? Or ist this a server config thing?
Answers.UserDisplayName: KSPR
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-11T19:02:14.990Z
Answers.Text: I'd guess it's an plugin issue, but not 100% sure.
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-13T12:32:37.933Z
Answers.Text: I'll check back with the plugin dev
Answers.UserDisplayName: KSPR
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-06T17:40:13.880Z
Answers.Text: `c` is valid format for the `date()` function, it outputs in ISO8601 http://php.net/manual/en/function.date.php
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-07T04:24:42.580Z
Answers.Text: @carlcs oops... my bad!
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-07T11:27:13.170Z
Answers.Text: The plugin dev hasn't answered on my github ticket so far 
Answers.UserDisplayName: KSPR
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-07T14:34:03.623Z
Answers.LastActivityDate: 2017-12-07T04:24:34.087Z
Answers.LastEditDate: 2017-12-07T04:24:34.087Z
Answers.UserDisplayName: Brad Bell
Body: <p>I want to get the lates <code>postDate</code> of a List and format it for the <code>cache</code> tag</p>
  
  <pre><code>{% set latestSubmission = craft.amForms.submissions(
      { formHandle: 'reservation', order: 'dateCreated desc' }).datum('&gt;= '~now).dateCreated().first()
  %}
  
  {{ latestSubmission }}
  </code></pre>
  
  <p>This Returns: </p>
  
  <blockquote>
    <p>Do., 07 Sep. 2017 10:32:05</p>
  </blockquote>
  
  <p>But I want to pass it into the Cache Tag so I want to format it and write:</p>
  
  <p><code>{{ latestSubmission | date('c') }}</code></p>
  
  <p>This returns the error:</p>
  
  <blockquote>
    <p>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</p>
  </blockquote>
  
  <p>Why? Why can’t I reformat it when it is already returning a date?</p>
  
Tags: <datetime><postdate><plugin-amforms>
Title: DateTime::__construct(): Failed to parse time string
ThreadText: # DateTime::__construct(): Failed to parse time string
  
  (Asked by: username_0 on 2017-09-07)
  
  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('>= '~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?
  
  **Tags:** datetime, postdate, plugin-amforms
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-09-07. Score: 1 | Accepted answer
  
  You're getting that error because `Do., 07 Sep. 2017 10:32:05` isn't in a valid PHP [Date/Time format](https://secure.php.net/manual/en/datetime.formats.php) when you pass it into the `|date` filter.
  
  Changing it to `07 Sep. 2017 10:32:05` should work.
  
  > **Comments:**
  > **username_0**: But that means the `latestSubmission` tag which gets it's data from the am forms plugin saves the date in the wrong formate in the db? since there is no manipulaiton on my side ??? Or ist this a server config thing?  
  > **username_1**: I'd guess it's an plugin issue, but not 100% sure.  
  > **username_0**: I'll check back with the plugin dev  
  > **username_2**: `c` is valid format for the `date()` function, it outputs in ISO8601 http://php.net/manual/en/function.date.php  
  > **username_1**: @username_2 oops... my bad!  
  > **username_0**: The plugin dev hasn't answered on my github ticket so far   
  
  ---
  
  