• I have a website that features a calendar of events. I want to be able to show the client what the website looks like in various states. I would like to show them what the site looks like when:

    • There are many upcoming events
    • There is one upcoming event
    • There are no upcoming events
    • There is an upcoming event, but not this month

    I can only think of two ways to do this.

    1. Add/edit/delete all of the events to create the scenarios above. But, that takes time, so I’d have to schedule multiple calls to demonstrate each state.
    2. Create multiple websites and enter the events in such a way as to create one website for each of the bullets above.

    Both of these seem like crazy overkill. The easiest solution is what this post is about.

    How do you change the date to override today’s current date?

    What if you wanted to create a website that thought today was August 6th, 1870? Or 1970? How would you do that?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    I’d build the site in a virtual machine and mess with the system date and create videos to do the demo.

    Moderator bcworkz

    (@bcworkz)

    Demo videos are a great suggestion. If for some reason you need to demo your site in a fully interactive manner, you could create a series of PHP scripts that dynamically setup the various conditions based on the current date. The scripts could all be contained in one custom page template and you use that page to setup each situation as desired.

    Perhaps as a series of links that activate various scripts on the page. All the event data could pre-exist in draft mode and the scripts selectively publish or un-publish events to setup each scenario, altering the dates of each event relative to the current date. I don’t see the underlying code being all that complicated. A few loops driven by specific post IDs.

    Essentially similar to you number 1 concept, but no need to schedule anything, just click on the appropriate link on a page and the scripts do the rest.

    Thread Starter swani

    (@swani)

    I really like both of these ideas. Ultimately, the first one was just over my head. I sort of went with a hybrid of the two ideas. I created two websites, one on my dev server, one on my local development environment and set up the events slightly differently. Then I did a screen share with the client to demo both. I half way through the call, I deleted a bunch of the events to illustrate the last few bullets. The events can be restored, from the trash in bulk, so that allowed me to show how the site changes as the event lineup changes.

    Thank you both for your suggestions and taking the time to answer. I may still look at doing both of them if I have to do this a lot in the future. I hope this project is close enough to complete that I can limp through with my incomplete solution.

    I do find it kind of funny with all the things that we can tell a computer to do, we can’t tell it what time it is. (Not easily, anyway).

    Swani

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Override System Date (not format or timezone)’ is closed to new replies.