Save records with column as 'created_date' which has CURRENT_TIMESTAMP which should be UTC time and not local time
UTC_TIMESTAMP() function
In MySQL, the UTC_TIMESTAMP returns the current UTC date and time as a value in YYYY-MM-DD HH:MM:SS or YYYYMMDDHHMMSS.uuuuuu format depending on the usage of the function i.e. in a string or numeric context.
Note : Since UTC_TIMESTAMP() works on current datetime, your output may vary from the output shown.
Syntax: UTC_TIMESTAMP; UTC_TIMESTAMP()
Code: SELECT UTC_TIMESTAMP,UTC_TIMESTAMP();
Sample Output:
mysql> SELECT UTC_TIMESTAMP,UTC_TIMESTAMP();
+---------------------+---------------------+
| UTC_TIMESTAMP | UTC_TIMESTAMP() |
+---------------------+---------------------+
| 2015-04-14 22:52:11 | 2015-04-14 22:52:11 |
+---------------------+---------------------+
1 row in set (0.01 sec)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With