Convert date to a different timezone

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Tubbietoeter
Forum Contributor
Posts: 149
Joined: Fri Mar 14, 2003 2:41 am
Location: Germany

Convert date to a different timezone

Post by Tubbietoeter »

Hi,

I couldn't find a function to convert dates to different timezones.
Do you know how to achieve this?
I need to allow users on a website to chose their local timezone and display the dates in that timezone. Server time is UTC.

Thanks,

Steff
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

Add remove the required time yourself:

User in New York

Code: Select all

$time = 3784638563;
$dif = -5;
$new_time = $time+(60*60*$dif)
Post Reply