How to add one hour in php date?

How to add one hour in php date?

I have a date variable in PHP and I want to add one hour to it. What is the code for adding one hour to the PHP date?

Thanks

View Answers

February 14, 2015 at 4:18 PM

Hi,

You should convert the date into time and then add convert the 60 minute (one hour) into time.

Then add the both to get and convert it to date. This way you can achieve the result.

$currentTime = time($todayDate);

//Add one hour equavelent seconds 60*60

$timeAfterOneHour = $currentTime+60*60;

Check the tutorial Adding one hour in php.

Thanks









Related Tutorials/Questions & Answers:
How to add one hour in php date?
PHP Date add 1 hour
Advertisements
javascript add hour to time
How to Addding One Month with PHP ?
days between two given dates using PHP
How can we know the number of days between two given dates using PHP?
PHP Date compare the dates, PHP Compare dates example
how can i display the dates of one week by selecting the date randomly from the calendar?
PHP Date add 1 month
PHP Date add 1 year
How to Add Array Item in PHP
ModuleNotFoundError: No module named 'datec'
ModuleNotFoundError: No module named 'datec'
how to dynamically create one file with any example in php
PHP and MySQL BETWEEN dates with different years
PHP add parameter to url - PHP
PHP date add, PHP Date addition to a date object
python add one day to date
python add one day to date
add one row after another
list of all months between two dates in java
list of all months between two dates in java
PHP Date add days
How to add
how to scrape the data from one website another website using html dom parsing in php
PHP GD add text to image
PHP GD add text to image
How to select Data Between Two dates in Java, MySQL
How to add "View more results" kind of functionality in my PHP based website?
ModuleNotFoundError: No module named 'django-dated-values'
PHP GD Add Border to image
PHP date add function
Comparing two dates in java
PHP Date add 1 day
Javascript calculate number of days between two dates
PHP Date add 1 week
Array Add Key Value PHP
how to add to numbers in java
How to add JTable in JPanel
how to add dynamic data
how to add mulitiple projections
PHP Array Push
How to add BigDecimal in Java?
how to add a file in GZIP
how to add plugins into eclipse
how to add scrollbar to JFrame
how to add scrollbar to JFrame
how to add scrollbar to JFrame
how to add scrollbar to JFrame
how to add scrollbar to JFrame

Ads