Sync Server Time with User's Timezone
I personally would have saved it as a simple timestamp rather than a date, whether or not that's actually a better idea is debatable, but a timestamp requires half as much space as a datetime and is, imo, much easier to use.

On the client side you can get the user's UTC offset with a simple new Date().getTimezoneOffset() which will return the difference between the user's time and UTC in minutes (multiply by 60 to get seconds). Then you can use PHP's time() function to get the current timestamp and subtract the user's offset.

When you need to display it as a human readable date, PHP's date() can take a timestamp as a second parameter to display a specific time. Timestamps are just a lower level, more efficient way to handle time differences.

if($this-&gt;userIsAuthenticated())
{
   $this-&gt;session-&gt;timezone_offset = "-600"; // this value is coming from db
}

// inserting records
$data = array("created_time"=&gt;time());
$this-&gt;db-&gt;insert("my_table", $data);

// fetching records
$date_from_db = $row-&gt;created_time;
$display_date = date("m/d/Y h:i a", $date_from_db - ($this-&gt;session-&gt;timezone_offset * 60));