Displaying time in different time zones

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

(yes, another timezone question...)

I'm trying to get to grips with times, and as an exercise am trying to
create a function to display the time in various places.

The way I'm currently doing this is as follows:

// -------------------------------
putenv("TZ=GMT"); //set to GMT
$time_to_convert = mktime(15,0,0); //gives me 3pm GMT

echo(strftime('%d/%m/%y %H:%M',$time_to_convert)); //3pm

echo(strftime('%d/%m/%y %H:%M',$time_to_convert)); //7pm
// -------------------------------

That seems to work fine, and gives me the dates in the various places.
The question I have, is how can I determine if a given country is in

Essentially, what I want to achieve is a list that will tell me what
time it is in a given country right now.  (A bit like the World Clock
http://www.timeanddate.com/worldclock /)



Re: Displaying time in different time zones

Cylindric wrote:
Quoted text here. Click to load it


  <?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com    Blog: http://rajeshanbiah.blogspot.com /

Re: Displaying time in different time zones

hmmm, that looks interesting.  Should be able to get a decent list out
of that.  thanks

Site Timeline