cluce Posted August 15, 2007 Share Posted August 15, 2007 In the following string I have a system date and time that displays on a web page from the database. The problem I have is the web server is in a different time zone as I am. Can someone tell me how to format this query to central time? Can this be done in MySQL? OR it has to be done in PHP? //gather the topics $get_topics_sql = "SELECT topic_id, topic_title, DATE_FORMAT(topic_create_time, '%b %e %Y at %r') aS fmt_topic_create_time, topic_owner FROM forum_topics_reagan WHERE topic_id = '".$_GET["topic_id"]."' LIMIT 1"; Quote Link to comment https://forums.phpfreaks.com/topic/65122-how-to-format-code-in-a-sql-query-to-central-time/ Share on other sites More sharing options...
lemmin Posted August 15, 2007 Share Posted August 15, 2007 Here is the list of all the format operators: http://dev.mysql.com/doc/refman/4.1/en/date-and-time-functions.html#function_date-format Quote Link to comment https://forums.phpfreaks.com/topic/65122-how-to-format-code-in-a-sql-query-to-central-time/#findComment-325113 Share on other sites More sharing options...
cluce Posted August 16, 2007 Author Share Posted August 16, 2007 yes, I got all of those but if I have the server in a pacific time zone and I need the web to display central time, can someone tell me how to get this configured to display central time. I thought it would be pulling the time from the system time but I tried that and it didnt work. Is there something in myssql config/settings to change this to central? Quote Link to comment https://forums.phpfreaks.com/topic/65122-how-to-format-code-in-a-sql-query-to-central-time/#findComment-325740 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.