rgb192
asked on
want to set the timezone in mysql also
<?php
echo date_default_timezone_get();
$currenttime = date('h:i:s:u');
list($hrs,$mins,$secs,$msecs) = split(':',$currenttime);
echo " => $hrs:$mins:$secs\n";
date_default_timezone_set('US/Eastern');
echo date_default_timezone_get();
$currenttime = date('h:i:s:u');
list($hrs,$mins,$secs,$msecs) = split(':',$currenttime);
echo " => $hrs:$mins:$secs\n";
date_default_timezone_set('America/New_York');
echo date_default_timezone_get();
$currenttime = date('h:i:s:u');
list($hrs,$mins,$secs,$msecs) = split(':',$currenttime);
echo " => $hrs:$mins:$secs\n";
?>
but this mysql query keeps the timezone of the server
mysql_query("update table set sent=NOW() ");
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Check this link
ASKER
i think these are similar links to mysql.com
I am using godaddy shared server
and mysql thinks it is mountain time zone
do I have to contact godaddy
because I do not have command line access to
mysql> SET GLOBAL time_zone = timezone;
>>However, if you are on a shared server, you must set the time zone for your connection every time you connect on a new PHP page.
is this done in php/mysql connection string
I am using godaddy shared server
and mysql thinks it is mountain time zone
do I have to contact godaddy
because I do not have command line access to
mysql> SET GLOBAL time_zone = timezone;
>>However, if you are on a shared server, you must set the time zone for your connection every time you connect on a new PHP page.
is this done in php/mysql connection string
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
See the part about "Storing Date" in this article.
https://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_201-Handling-date-and-time-in-PHP-and-MySQL.html
https://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_201-Handling-date-and-time-in-PHP-and-MySQL.html
ASKER
>>
See the part about "Storing Date" in this article.
http://dev.mysql.com/doc/refman/5.5/en/datetime.html
I can not find 'insert a date 1 hour more'
>>
Use a query that says something like SET time_zone = '+00:00' to adjust the value in MySQL
I found this in your article but this query does not change the result in shared server, I have not tried localhost yet
See the part about "Storing Date" in this article.
http://dev.mysql.com/doc/refman/5.5/en/datetime.html
I can not find 'insert a date 1 hour more'
>>
Use a query that says something like SET time_zone = '+00:00' to adjust the value in MySQL
I found this in your article but this query does not change the result in shared server, I have not tried localhost yet
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks
best answer is
this wont work BECAUSE i am using a shared server
best answer is
this wont work BECAUSE i am using a shared server