Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Failed to parse time string

Started by Don Robertson 1 year ago · 2 replies · 137 views
1 year ago

Hi - trying to save a page and am getting a server error:

Server Error

Sorry, something went terribly wrong!

0 - An exception has been thrown during the rendering of a template ("Failed to parse time string (13/01/2025) at position 0 (1): Unexpected character")

The header of the page is:


publish_date: 10/07/2023
title: 'JaniKing Cricket Beano'
author: 'Don Robertson'
body_classes: 'header-lite fullwidth blogstyling'
taxonomy:
category:

  • blog
    tag:
  • NZervio
  • 'Building Maintenance'
    media_order: highcleaning.jpg
    date: 10/07/2023

The date format in the user/config/system.yaml file is

dateformat:
default: d/m/Y
short: 'jS M Y'
long: 'F jS \a\t g:ia'

I've had this problem before and don't recall what I did - I think I modified the theme to ignore the system date formats, but I'd like a decent fix if possible.

Also - clearing the cache doesn't help. If I edit the md file and change the title, refresh the cache and then try to edit the page in Admin, I see the changed title, but still get the error - even though the date in the error message (today's date) isn't in the md file.

The page displays as expected. Other pages with the same dates in the header file - in fact I copied the header section from one page to another - can be edited.

1 year ago

But I can't see the Date 13/01/2025 in the Page-Header. Is it somewhere else?

1 year ago

Okay - if I save a date in the editing page as 10/01/2025, it saves, but the date gets changed to 01/10/2025. It gets displayed on the page as 10 January 2025.

If I enter the date - using the date picker - 15/01/2025, it errors. If I manually try to enter 01/15/2025, it won't let me - the date changes back to what it was.

Changing the page date format to d-m-Y H:i, it is fine. If I use a custom date/time format - eg d/m/Y H:i, it defaults back to m-d-Y. And then errors for days after the 12th of the month. d/m/Y is a pretty common format.

Also - to get rid of the error, you need to go to the Dashboard and then clear the tmp cache. Clearing ALL or using the icon at the top of the side bar doesn't work.

last edited 01/20/25 by Don Robertson

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 57 14 hours ago
Support · by Anna, 3 days ago
2 65 17 hours ago
Support · by Justin Young, 18 hours ago
1 33 18 hours ago
Support · by Duc , 1 week ago
2 68 5 days ago
Support · by Colin Hume, 1 week ago
2 60 6 days ago