The best way to store timestamps is with UNIX timestamp integers in GMT / UTC. This allows you to always know the exact time no matter where you are, your server or your users. The bonus is that you can let your users set their time zone and display time that is meaningful to them.
$sql = "INSERT INTO `Lines` (`timestamp`) VALUES ('" . time() . "')";
or
$sql = "INSERT INTO `Lines` (`timestamp`) VALUES ( UNIX_TIMESTAMP() )";
Be careful if you decide to use NOW () or CURRENT_TIMESTAMP, as they are controlled by the database server and its settings. If the server on which your site is hosted is in one time zone and you are switching to another host in a different time zone, all your timestamps will be incorrect. Using Unix integers will add a bit of extra effort wherever you apply the application, but it gives you maximum accuracy and maximum flexibility.
source share