FRIHOSTFORUMSSEARCHFAQTOSBLOGSCOMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Server time not local





medesignz
I am wondering how to change time from server local time to my local time (GMT)

Its mainly on event data from MySQL to a php page.

Can you help?
mexiwithacan
Maybe you can create a view that has a calculated column like the following snippet.
Code:
CONVERT_TZ(SystemDateTime, @@global.time_zone, @@session.time_zone) AS LocalDateTime

I got this idea from the following two articles:

"11.6. Date and Time Functions"
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_convert-tz

"9.6. MySQL Server Time Zone Support"
http://dev.mysql.com/doc/refman/5.1/en/time-zone-support.html[/code]
medesignz
Sorry, my question was worded really badly.

Basically its an events page where events happen across the world.

I want to view all events by time, but according to my time (GMT), although they could have been submitted in any other timezone format.

eg If an event is happening in France at 8pm, it will appear on my page as 7pm

working on date_default_timezone_set is not helping.
Nemesis234
there is no fucntion in php to retrieve a users' local time, in this case yours - being GMT.
the only true solution is to have each user set their time zone, or retrieve their browser time via javascript, then work out from that what time-zone they are in and adjust the times displayed accordingly.
jmraker
You could add javascript to your site that creates a cookie which is sent on every page

http://www.netlobo.com/from_javascript_to_php.html
Related topics
can't login my domain server ?
NNTP-News Server in 5 minutes
error: Can't connect to local mysql server through socket
Who is PHP and MySQL local server program best
Local server
local pop3 server for Windows, anyone?
Is there any local php server program?
How to Set up Local Web Server
Help importing CSV file into MySQL database
Web prefabricada o Web casera
Nothings Working ? Permissions -- Account Creator
Consegui un Chat Software Free Dowmload
#2002 - The server is not responding (or the local MySQL ser
Dreamweaver and Local Testing Server
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.