Question: I have gone through many timezone/PHP posts, and most suggest storing your datetime fields in UTC, then using the application users timezone offset when storing and displaying datetime information. 

The problem i have I've inherited an application that wasn't timezone aware, and now I need to cater for this.

The server is already set to `"EST +11:00 Australia/Melbourne"`, and there are already applications running from that server. So i can't change this.

Fortunately, I do know a users timezone offset, ie `-05:00`, etc,.

The application takes Javascript Dates and parses them using PHP's `strtotime()` function and stores in a MySQL database, like this:

```
$event_starts = date('Y-m-d H:i:s', 
    strtotime('Thu Dec 02 2010 11:15:00 GMT+1100 (AUS Eastern Daylight Time)');

```

So does anyone have any suggestions for the best way on how I can make this application timezone aware considering the server isn't set to UTC? 

Many thanks, J.

Answer: 
The important thing to keep in mind is not UTC, but that all times stored must be standardized to one timezone. So, if your PHP server and your database server both use the same timezone, the only issue that arises is when you need to display a location-aware time to the user or when you allow a user to enter a datetime from another timezone.

PHP has a nice, though somewhat scantly documented class, called [DateTime](http://ca2.php.net/manual/en/class.datetime.php). And some ancillary classes like [DateTimeZone](http://ca2.php.net/manual/en/class.datetimezone.php), DateInterval, etc. These make converting from db time to user time pretty simple.
First of allyou have to convert the date time selected by user to **timestamp**.

You have to use **Server time zone offset** and save the time to server **in GMT.**

This is the best way because while displaying the date just add the offset of the user 

and convert and show.

I have implemented this for my client as it was an auction site and user may add item from AUS in his time and bidder will be from US. Time zone issues was there and we implemented after a lots of rerence.

You know one thing best and **easy** way is , do like **ebay** . just save the user time zone and show time with the time zone. No conversion nothing. Simple and better . 10:35 EST :)

If you wannabe perfect in time zone conversion, think about daylight saving time also. start date and end date on each year will change slightly. If you want to be accurate you have to save the daylight starting and ending date in db and add that difference too .:)