Php current date plus 1 hour
here is my code for the current date time (now): Show
how can I add one hour while keeping that format? asked May 28, 2017 at 4:12
0
answered May 28, 2017 at 4:14
Louay HamadaLouay Hamada 7611 gold badge14 silver badges21 bronze badges You can do this simply with
answered May 28, 2017 at 4:14
Here we are using Try this code snippet here
answered May 28, 2017 at 4:17
Sahil GulatiSahil Gulati 14.8k4 gold badges23 silver badges42 bronze badges 0 November 10, 2021 Category : PHP In this example, you will learn how to add hours to date time in php. I’m going to show you about how to add hours to current date in php. it's simple example of how to add 12 hours to date in php. let’s discuss about how to add 5 hours to date in php. I will give you very simple example how to add hours to date and time in PHP. so let's see both example with output: Example 1: PHP Add Hours to DateTime index.php
Output:
Example 2: PHP Add Hours to Current DateTime index.php
Output:
i hope it can help you... Hardik SavaniI'm a full-stack developer, entrepreneur and owner of Aatman Infotech. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency. Follow Me: We are Recommending you
Popular Posts
Categories
Latest Posts
How to add 1 hour with current date in php?$my_date_time = date('Y-m-d H:i:s');
How do you add hours on Strtotime?You can use DateTime::modify to add time, but I would just do time()+10800 .
How do you add a day in Strtotime?You should use: date('Y-m-d H:i:s', strtotime($stop_date . ' + 1 day')); as in the answer that @w35l3y gave you.
|