Search code examples
parsingdatetimejoomla

Joomla - DateTime::__construct() [datetime.--construct]: Failed to parse time string


Since I develop under J3.2, I've got a recurrent error with the Joomla "calendar" field.

Once the field value is recorded in BDD with the sql format : "Y-m-d H:i:s", I've got an error 500 when I open the form for edit my content.

DateTime::__construct() [datetime.--construct]: Failed to parse time string (2014-10-17 10-28-58) at position 11 (1): Unexpected character

The component K2 and all these associated extension are disabled.

It appear that the parser have a problem with the empty string between the date and the time.

Is anybody can give me a solution ??

Thankz by advance for your help !

Mickael


Solution

  • I found my mistake : the format string of my calendar field was bad.

    I used "Y-m-d H-i-s" instead of "Y-m-d H:i:s"