Page 1 of 1

500 - DateTime::__construct() [datetime.--construct]

Posted: Wed Oct 17, 2012 12:02 am
by suttie
I use the latest version of joomla. I have installed K2 and there is some issue with datetime on the items. Also there is an error page when users try to add a post

Code: Select all

500 - DateTime::__construct() [datetime.--construct]: Failed to parse time string (17/10/2012 10:56:06) at position 0 (1): Unexpected character 
I did a lot of research on the subject and this issue is not uncommon. it seems to be related with a multilanguage site due the different timezone.

Often it occurs with some extensions but I'm not sure if the issue can be solved in joomla system or have to work in the extension.

I didn't fnd any solution on my research

Re: 500 - DateTime::__construct() [datetime.--construct]

Posted: Thu Oct 18, 2012 1:58 am
by suttie
I need some help with this issue. I found lots of questions about this but no solutions.
However the issue is related to the extension I think there is some rules for timezone in joomla system that would help.
I already checked the php information at the hosting and everything is ok.

Re: 500 - DateTime::__construct() [datetime.--construct]

Posted: Sun Oct 28, 2012 6:45 am
by suttie
At last I discovered the solution for this issue. I'm posting here in case somebody else has the same problem.
There is an error in the language translation. You have to change the date format at the file

Code: Select all

administrator\language\pt-BR\pt-BR.com_k2.ini
Change this original

Code: Select all

K2_J16_DATE_FORMAT="d/m/Y - H:i"

K2_J16_DATE_FORMAT_CALENDAR="d/m/Y H:i:s"

K2_J16_DATE_FORMAT_LC2="l, d F Y H:i"

K2_J16_DATE_FORMAT_LC="l, d F Y"
For this

Code: Select all

K2_J16_DATE_FORMAT="d-[URL banned] H:i"


K2_J16_DATE_FORMAT_CALENDAR="d-[URL banned] H:i"


K2_J16_DATE_FORMAT_LC2="d-[URL banned] H:i"


K2_J16_DATE_FORMAT_LC="d-[URL banned] H:i"
I found the solution in www.joomlaclube.com.br

Re: 500 - DateTime::__construct() [datetime.--construct]

Posted: Mon Oct 29, 2012 6:21 am
by infograf768
I suggest you let this know to K2 people.

Re: 500 - DateTime::__construct() [datetime.--construct]

Posted: Mon Oct 29, 2012 7:36 am
by suttie
Yeah, I also post in their forum

Re: 500 - DateTime::__construct() [datetime.--construct]

Posted: Sun Dec 23, 2012 8:56 pm
by DJsOak4
In my case, I do not have K-2 installed and in Administrator/Languages, there is no pt-BR, there is en-GB, override and index and none of those have an extension as you mention. Any other ideas, please?

Re: 500 - DateTime::__construct() [datetime.--construct]

Posted: Mon Dec 24, 2012 7:09 am
by infograf768
DJsOak4 wrote:In my case, I do not have K-2 installed and in Administrator/Languages, there is no pt-BR, there is en-GB, override and index and none of those have an extension as you mention. Any other ideas, please?
Please first describe your issue and ways to reproduce.

Re: 500 - DateTime::__construct() [datetime.--construct]

Posted: Mon Dec 24, 2012 2:01 pm
by DJsOak4
I sure appreciate any help you can give. I posted the following at http://forum.joomla.org/viewtopic.php?f=622&t=729865 but haven't had a response. I won't re-post the screen shot here, but it is in the other post if you want to look at it. I've been searching for this error re: Joomla and/or the specific templates to no avail so far as to something that works.

This error occurs on two RocketTheme templates (Radiance and Infuse), but not a template from another provider. If you “forget password” and go through all the hoops to where you can once again log in, you get this error: 500 - DateTime::__construct() [datetime.--construct]: Failed to parse time string (%2055-%07-%26) at position 0 (%): Unexpected character with a screen shot like the one attached. If you backspace the url to the site, it does log you in. I discussed what humvee said with our host and he said if it was a problem on the server end, it would be on many sites. The site with the problem is http://www.yahwehschildren.com and the one without the problem is http://www.yaim.org. I compared php information and the php.ini files and they are the same. Can anyone help?

Re: 500 - DateTime::__construct() [datetime.--construct]

Posted: Tue Sep 17, 2013 6:50 pm
by kelsen12
Thank you dear friend, solved my problems :D

Re: 500 - DateTime::__construct() [datetime.--construct]

Posted: Thu Nov 26, 2015 9:10 am
by Alberto_7721
In my case the solution is the follow:
I created in k2 extra fields in date format. If you don't fill these fields with a date or if you fill different data (es: missing, ecc..) you will have the error. Instead if you fill with a date works fine.