Support » Plugin: Event Organiser » Warning: DateTime::format() [function.DateTime-format]:

  • Resolved nightclaw


    Hi there,
    thanks for the help in advance!

    I’ve posted some events and when i hit the category page for the first time the events are showing up just fine.
    When i now visit e.g. click on category or venue or refresh that page the following error appears where the date / time normally should be.
    Warning: DateTime::format() [function.DateTime-format]: The DateTime object has not been correctly initialized by its constructor in /var/www/vhosts/ on line 35

    visit for a working example 😉

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Stephen Harris


    Have you added/updated any plug-ins in between it working ok, and not? Have you tried disabling other plug-ins just in case? I’ve never seen anything like this before I’m afraid… :/

    I am not sure if it ever worked correctly, because i did not use it actively until yesterday.
    Could you tell me how to test if it’s my webhosting setup that’s causing the trouble? Normally time and date are showing just fine. Are there PHP snippets to test the functions?

    Plugin Author Stephen Harris


    You can use to check the PHP version (plug-in supports only 5.2+ which is the currently the minimum requirement of WordPress too).

    Judging by this it seems the problem is caching DateTime objects in PHP 5.2 – do you have any caching plug-ins enabled? Does disabling them solve the issue?

    Plugin Author Stephen Harris


    Another possible test is to edit this line:

    So that $occurrences = false; to prevent it from trying to use cached DateTime objects. If this solves the problem let me know and I’ll implement a work-around in 1.7.4.

    Excellent: Your server is running PHP version 5.2.4-2ubuntu5.26 and MySQL
    version 5.0.96 which will be great for WordPress 3.2 onward.

    Yes i use XCache on my Webserver and WP-Super-Cache as Plugin, disabling the plugin didn’t help.

    With the work-around $occurrences = false; it now seems to work!

    Let me know i you need additional testing or information for further development. Thanks a lot for the fast help!

    Plugin Author Stephen Harris


    Great! I’ll introduce a work-around in 1.7.4- so once it’s released feel free to update and check the problem hasn’t reoccurred.

    Thanks for your help!

    Did the update and it works like a charm! great job!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Warning: DateTime::format() [function.DateTime-format]:’ is closed to new replies.