WordPress.org

Ready to get started?Download WordPress

Forums

PHP Date Function Question (3 posts)

  1. jmarcello
    Member
    Posted 2 years ago #

    How do you display the date based on the end-users local computer, not the server?

    Any help is greatly appreciated. Thanks.

  2. vtxyzzy
    Member
    Posted 2 years ago #

    I am no expert on the subject, but I suspect that you cannot do that with php since it is executed on the server.

    My guess is that you would need to use javascript.

    Maybe a js expert can offer some help.

  3. Harry
    Member
    Posted 2 years ago #

    vtxyzzy is correct about the PHP

    If you're a beginner to javascript, probably the simplest way of output the current time on your site is:

    Simple Javascript Date

    Javascript as was mentioned runs in the browser, on the site visitors side of things. Above is not necessarily the cleanest way to do things but it's definitely the easiest if you're new to Javascript. Most JS Experts may bamboozle you with why you shouldn't use 'document.write' etc.

    Good luck with your query, hope this helps.

Topic Closed

This topic has been closed to new replies.

About this Topic