I have a database, which includes datetime of purchases. I would like to display it on the website 6 hours sooner that datetime in database.
(unlike) How to subtract hours from a datetime in MySQL?
I need PHP method to achive this
$dt = new DateTime($row["datetime"]);
$dt->modify('-6 hours');
Date and time is saved in $row["datetime"]. The code above doesn't work, but on many places this is stated as the proper code.
Example of what I would like to do:
Time in database: 2019-01-17 20:13:12 On website, I would like: 2019-01-17 14:13:12