Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7066821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:07:36+00:00 2026-05-28T05:07:36+00:00

We use very simple php function to display time and date. <div class=datedata><?=date(l, F

  • 0

We use very simple php function to display time and date.

<div class="datedata"><?=date("l, F jS, Y", time());?></div>

But I was thinking how would I display the actual time in differennt Australian States.

I used to know the script for displaying the time of our server, which is in nsw but forgot it. Guess that would be easiest.. display server time and then show diff times based on server time + / – 1 hr whatever…

Wonder if anyones got any suggestions..
Cheers

With @crolpa help this is what I have, like i said .. im crap with php.

<?php
date_default_timezone_set('Australia/Adelaide');
$adelaide = time();

date_default_timezone_set('Australia/Melbourne');
$melbourne = time();

date_default_timezone_set('Australia/Sydney');
$sydney = time();

//etc...

?>

<?=date("G:i a",$adelaide)?><br />
<?=date("G:i a",$melbourne)?><br />
<?=date("G:i a",$sydney)?><br />
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:07:37+00:00Added an answer on May 28, 2026 at 5:07 am

    You can add the offsets to the base time. So..

    $offset = 3600 * 1.5 //+ 1.5 hours
    
    $timestamp = time() + $offset;
    
    echo date("l, F jS, Y",$timestamp);
    

    The default time() function is set by your server. You can change this easily with at the beginning of your script:

    date_default_timezone_set('Australia/Adelaide');
    

    This can also be used through your script to simulate different timezones.

    date_default_timezone_set('Australia/Adelaide');
    echo date("l, F jS, Y",time());
    
    date_default_timezone_set('Australia/Melbourne');
    echo date("l, F jS, Y",time());
    
    date_default_timezone_set('Australia/Sydney');
    echo date("l, F jS, Y",time());
    

    This is the easiest way, that will also adjust automatically with daylight savings:

    <?php
        date_default_timezone_set('Australia/Adelaide');
        $adelaide = time();
    
        date_default_timezone_set('Australia/Melbourne');
        $melbourne = time();
    
        date_default_timezone_set('Australia/Sydney');
        $sydney = time();
    
        //etc...
    
    ?>
    
    <?=date("l, F jS, Y",$adelaide);?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've written what I thought was a very simple use of the php explode()
My use case is very simple : I have a GUI application, and inside
For a very simple profiling I use microtime() like this: $now = microtime(); for
I need to use or stimulate a very simple session object inside my WCF
I've developed a very simple host and client which I wanted to use to
I want to use the Django admin interface for a very simple web application
I'm coding a simple code editor for a very simple scripting language we use
i dunno, but will your machine suffer great slowdown if you use a very
I have a PHP form that needs some very simple validation on submit. I'd
I have a simple update set php sql function on my site where I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.