Results 1 to 4 of 4

Thread: Displaying server time on a webpage with a +6 hour offset

  1. #1
    Junior Member
    Join Date
    Nov 2005
    Posts
    1

    Default Displaying server time on a webpage with a +6 hour offset

    Anyone know the simplest way to do this?

    I've done many hours of google searching and either get scripts that display only the users local computer time or the ones that do indeed display the server time I can't see a way to add the offset.

    If anyone could post the required code that would really be appreciated.

    Thanks in advance.

    Kibit.

  2. #2
    Junior Member
    Join Date
    Nov 2006
    Location
    Waterloo, ON
    Posts
    16

    Default

    What language does it have to be in? In PHP:

    Code:
    strtotime("+6 hours");
    would suffice.

  3. #3
    Senior Member
    Join Date
    Apr 2004
    Location
    Manchester, UK
    Posts
    168

    Default

    A while since I played with this, but I think I found the best way to handle timezones was using:

    PHP Code:
    date_default_timezone_set(); 
    and

    PHP Code:
    date_timezone_set() 
    http://uk2.php.net/manual/en/functio...mezone-set.php
    http://uk2.php.net/date_timezone_set

  4. #4
    Senior Member
    Join Date
    Mar 2004
    Location
    Australia
    Posts
    183

    Default

    Assuming you're using PHP, then Elite has pointed you in the right direction.

    I personally use the following:

    Code:
    date_default_timezone_set('Australia/Perth');
    echo date("D M j G:i:s T Y");
    You can customise the date's format as per php's date manual.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •