1
aussiechris
Add time to block (Fixed)
  • 2004/12/11 12:32

  • aussiechris

  • Just popping in

  • Posts: 3

  • Since: 2004/12/11


I cant seem to access my other thread, but I have solved my own problem. I have used the following code.


$timezone = 18
$calc = 3600*$timezone;
$date = gmdate("g:i a", time() + $calc);
$block['content'] .= "

Current time: $date
\n";

?>

Change the timezone to the number you need to add to get from the server timezone to the desired timezone. eg. from GMT-8:00 to GMT+10:00 is +18 hours. For reverse (GMT+10:00 to GMT-8:00) use -18. This seems to work for the moment.

Thanks for trying to help, and I hope this is usefull for somebody else.


Cheers again

Chris

2
Mithrandir
Re: Add time to block (Fixed)

This should take the server (and user) timezone into account:
$date formatTimestamp(time(), "g:i a");
$block['content'] .= "

Current time: $date
n"
;
?>

3
aussiechris
Re: Add time to block (Fixed)
  • 2004/12/11 22:49

  • aussiechris

  • Just popping in

  • Posts: 3

  • Since: 2004/12/11


sorry, I should have explained better.

I am using my site as a travelogue, so I want to be able to display the time of the city I am currently in, not the user time or the server time. This is so my friends can see the time where I currently am.

Thanks for the help

Login

Who's Online

311 user(s) are online (58 user(s) are browsing Support Forums)


Members: 0


Guests: 311


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Sep 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits