I have a mysql database table that gets the “datetime” column automatically filled when a user fills in the php form page.
$timestamp = datetime("Y-m-d H:i:s");
Trouble is, the database server is in the USA which is 9 hours 30 minutes behind my time.
Does anyone know a way to change this so that the 9 hours 30 minutes hours get added to the datetime?
To answer your question directly, you can use the following function in your select statement:
select date_add(datefield, interval 570 minute) from tableHowever, as stated in some of the comments it’s best if you correct the problem from the source and update the timezone in your DBMS.