Hi, My database server time zone is GMT-4.00 and i want to generate a report in various time zones like GMT,GMT+5.30, GMT+9.30 ... How i am doing is lets assume i am taking report for 9 july 2008 in GMT+9.30 timezone .. now, 9 july 2008 +4 hrs + 9.30 hrs will become my actual resultant time limit .. in that case .. i will get both 9 th and 10th report .. but i want that as only 9th .. will set time_zone="+9:30" and then querying will solve my problem or ... how to do that ... Problem in simple scenario is ... lets take Google Analytics .. lets assume that the database server time zone is GMT-4:00 .. when you register with analytics and pick up the timezone as GMT +5:30 .. Now all your reports will come as GMT+5:30 .. How they are doing it ..... Thanks in advance Adrevol
the answer in the above does not solve my problem ... because ... with the above adjusting timezone .. you can query database with converted times .. but .. what i want is resultset from database should be converted to the desired timezones ...
I'm guessing you are storing your dates as UNIX times, couldn't you just change the date('U') part to the result set UNIX time? Should work fairly easily. You could always just use date_default_timezone_set. Examples: date_default_timezone_set('Etc/GMT-5'); (This is GMT + 5) date_default_timezone_set('Etc/GMT+8'); (This is GMT - 8, West coast US) PHP: Dan