php - How can i change the timestamp to my own timezone in mysql? -
how can change timestamp own timezone in mysql?
here php code below:
$sql = "create table `mytable` ( `id` int(6) unsigned not null auto_increment, `firstname` varchar(30) not null, `lastname` varchar(30) not null, `email` varchar(50), `reg_date` timestamp not null default current_timestamp on update current_timestamp, primary key (`id`) ) ";
for single table , column, make view, converting timestamp column server's timezone actual timezone when select view instead of table itself.
create view `v_mytable` select id ,firstname ,lastname ,email ,convert_tz(regdate,'uct','us/pacific') regdate mytable;
if don't have convert_tz installed it's outlined on here how install it: mysql convert_tz()
Comments
Post a Comment