I hope you're all doing well. I have a little issue with adding one hour to a PHP variable that includes a date. Can someone please help me out with this?
Here's the situation: I have a PHP variable that stores a specific date and time in the format "Y-m-d H:i:s". Let's say for example my variable is called `$myDateTime` and it holds the value "2022-12-31 14:30:00".
Now, I want to add one hour to this datetime variable. So, after adding the hour, the new value of `$myDateTime` should be "2022-12-31 15:30:00".
I've been searching for a solution but couldn't find one that works correctly. Some methods I found only work with the current time or require modifying the original datetime format.
Could someone guide me on how to achieve this in PHP? Maybe there's a built-in function or a simple solution that I'm missing?
Thanks in advance for your help!