too long

Does using the DateTime constructor in this way: new DateTime("now"); return the server time or the client time?

If it gives it in the client time, how can I convert it into the server time?

That code returns the server time using the current default timezone.

From this

If it gives it in the client time, how can I convert it into the server time?

I infer that you want to store the time when the client request hits your database, if your clients are from an especific region or area, you can use this code (that returns a DATETIME Mysql data-like).

date_default_timezone_set("America/Lima");
$a = date("Y-m-d H:i:s");

There are plenty of timezones accepted by PHP, here you have the list: http://php.net/manual/en/timezones.php

But if not, then there's option two: create a function in the very same database and attach it to a trigger function every time there's any interaction with your db. For this, you can check the following pages: https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html https://dev.mysql.com/doc/refman/5.7/en/trigger-syntax.html