joomla installing new language DateTime::__construct(): Failed to parse time string (jerror)

25,410

Solution 1

This is the most stupid bug in Joomla 3. I wasted 2 days trying to solve this out and I found that the problem was that the log and tmp paths were not set correctly on the configuration.php

Don't worry there's nothing wrong with your Date/Time/Timezone/Localization settings. It's just a stupid silly message that doesn't relate to the actual problem.

To save your time I recommend you get the full path using this script:

<?php
$dir = dirname(__FILE__);
echo "<p>Full path to this dir: " . $dir . "</p>";
?>

Create a PHP file and upload it to Joomla root. It will get you the path correctly

My path looked exactly the same except that there was an uppercase letter screwing everything up.

Note that this error could happen if the folders doesn't have the correct permission (not writable)

Solution 2

I have a successful answer for this problem in joomla 3x

DateTime::__construct(): Failed to parse time string (jerror) at position 0 (j): The timezone could not be found in the database

  1. Set the correct path to your joomla site tmp folder

    Log in to joomla administrator Panal System -> global Configuration -> Server

    and give the correct path ("Path To Tmp Folder")

    EX: http://www.yourDomain.com/tmp

  2. Path to Sloving PHP file

    libraries/joomla/filesystem/folder.php

    Change Online 260 with this code

__METHOD__ . ': ' . JText::_('JLIB_FILESYSTEM_ERROR_COULD_NOT_CREATE_DIRECTORY'). 'Path: ' . $path, JLog::WARNING, 'jerror'

Solution 3

Ok just had the same problem, was helping a friend who couldnt get his new joomla 3 site to install a new template. Every thing looked good in system infomation, all writeable but on looking further I found although plugins/ was marked as writeable I had to change all the permissions for each folder in plugins/ and it worked straight away. Hope this helps.

Solution 4

I was able to fix this by creating /tmp and /log directories one level above the website root and making them writable.

Example:
/home/sitename/log
/home/sitename/tmp

Solution 5

This issue can be fixed easily.

go to plugins/system/yt/includes/libs/yt-minify.php

go to this line :

$this->optimizeFolder  = $app->getTemplate(true)->params->get('optimizeFolder', 'yt-assets');

and change it to :

$this->optimizeFolder = $app->getTemplate(true)->params->get('optimizeFolder', 'yt-assets');
$this->optimizeFolder = JPATH_ROOT.'/'.$this->optimizeFolder;

hope it works!

Share:
25,410
jeffery_the_wind
Author by

jeffery_the_wind

Currently a Doctoral student in the Dept. of Math and Stats at Université de Montréal. In the past I have done a lot of full stack development and applied math. Now trying to focus more on the pure math side of things and theory. Always get a lot of help from the Stack Exchange Community! Math interests include optimization and Algebra although in practice I do a lot of machine learning.

Updated on July 20, 2022

Comments

  • jeffery_the_wind
    jeffery_the_wind almost 2 years

    I am a fresh installation of Joomla 3.1 running on my home computer. My environment is Ubuntu 12.10 with apache server, php 5.4.6 installed. Since installing the system, no I am just trying to install more languages through the language manager: enter image description here

    As you can see, the 2 additional languages that I wanted show up in the list, but after selecting each language, and clicking "Install", I was led to a page with this message:

    DateTime::__construct(): Failed to parse time string (jerror) at position 0 (j): The timezone could not be found in the database

    With a button to just go back to the control panel. I was suprised to see these languages show up in the list.

    I also saw this message when I tried (and failed) to install my first component - it was a component to embed google maps in articles.

    Anyway, I haven't been able to find a solution for this problem online, I was wondering if anyone out there knows what the problem is. Any help is greatly appreciated!

    Thanks!

    EDIT

    The problem in my case turned out to be that some on my directories where un-writable. I went to the "directory permissions" tab under "System Information", and tried to make sure that all the directories were writable. When i first opened it, all the directories in the "administrator" directory were not writable, and we changed them to be writable through the shell in linux, then i was able to install the new languages without the error message above.

    enter image description here

  • jeffery_the_wind
    jeffery_the_wind about 11 years
    Thanks Ahmad, I checked my configuration.php and the logs and tmp paths are correct already... Not sure if maybe it is another problem with my config file.
  • jeffery_the_wind
    jeffery_the_wind about 11 years
    Yes I just did, and it path is exactly the same, except there is a $ character on the end of the output from dirname(__FILE__), but I think that is just a problem with my shell. SO yes the pathname is already correct.
  • Ahmad Alfy
    Ahmad Alfy about 11 years
    OK can you check the update and added? Also try adding this $ I think it is the problem.
  • Ahmad Alfy
    Ahmad Alfy about 11 years
    I am not sure about that $ ... PHP isn't suppose to echo it I think
  • jeffery_the_wind
    jeffery_the_wind about 11 years
    I checked system info, and the log and tmp files are writable, but I see that the language/overrides is not writable, and all the administrator folders are not writable... Do you think it could have something to do with the fact that my session handler is database? The error says coundn't find timezone in database.
  • Ahmad Alfy
    Ahmad Alfy about 11 years
  • Ahmad Alfy
    Ahmad Alfy about 11 years
    As a start I would say fix the permission issues. I don't think it's related to the timezone or the database to be honest
  • jeffery_the_wind
    jeffery_the_wind about 11 years
    I changed all the permissions so that the folders were writable, and that solved the problem!
  • Ahmad Alfy
    Ahmad Alfy about 11 years
    Perfect, it isn't a faulty write permission issue then. My case was wrong path and yours is un-writable directories. I will file a bug
  • Doug
    Doug almost 11 years
    just been cloning a J3 site from one server to another and ran into this issue... it was the tmp and log paths in the config file that I had neglected to change. It looks like you saved me days of work! Thanks.
  • ρяσѕρєя K
    ρяσѕρєя K about 8 years
    This should be a comment.
  • twan
    twan over 7 years
    What if you get the error when trying to login to the admin panel? I keep getting the error and the login credentials are correct.