You either have to use JS on the client side. 

Or you store the user's timezone as a preference in their profile and
compute using that by setting a TZ variable.

Normally you would store all data in mySQL in UTC and then convert on the
fly as mentioned above for each user. 

> -----Original Message-----
> From: saeed ahmed [] 
> Sent: Monday, March 15, 2010 1:11 PM
> To:
> Subject: [PHP] how to get the local time
> hi friends,
> I'm trying to set local time in my php script. I was trying 
> date and time
> function but its always show the server time not local time. 
> i need help on
> this problem. how can i set the local time. i need sweden time zone
> -----
> Regards
> Saeed Ahmed
> -----

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to