We're running an annual event website and we're keen to simulate the site for a different date. In other words, add say 3 months to the current date/time so we can try out some options for when the event's finished.

Anyone have any thoughts on where to start with this?

  • How are the events in the system? Are the entered as regular channel entries or are you using an addon? Are they output to the template files based on publish date or do you have a separate field for the event date?
    – Ian Young
    Apr 5, 2013 at 16:32
  • They're in as regular EE date fields in channel entries. The publish date isn't been taken into account at all for individual events. Apr 5, 2013 at 16:36
  • 1
    In that case can you not just edit the dates of a few of the entries to be past events so that you can test?
    – Ian Young
    Apr 5, 2013 at 17:45
  • Thanks Ian. We have some more generic settings to be applied after the festival, so changing the times of specific events wouldn't really allow us to test what we'd like to. Apr 5, 2013 at 19:28
  • Ah gotcha. Yes if there are several dependencies then Derek's suggestion is definitely a quicker way. If it's just checking date logic I normally find it just as easy to quickly edit some entry dates to make sure they're being handled correctly in the system.
    – Ian Young
    Apr 5, 2013 at 19:36

1 Answer 1


Ian's comment works, though this will be less laborious...

Open /system/expressionengine/libraries/Localize.php, and look inside the constructor (around line 53 or so). Comment out the setting of $this->now and change it like so:

// Fetch the current local server time and convert it to GMT
// $this->now = time();

// Temporarily setting the date to 3 months in the past
$this->now = strtotime('3 months ago');
  • Don't forget to mark Derek's answer as correct if it solves the issue. It helps for others in the future to quick find a solution that works.
    – Ian Young
    Apr 5, 2013 at 20:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.