PHP date hours ago

PHP date hours ago


Posted in : PHP Posted on : February 3, 2011 at 6:11 PM Comments : [ 0 ]

In this tutorial you will learn how find PHP date 2 hours ago in a PHP web application.

PHP date hours ago

In this tutorial you will learn how find PHP date 2 hours ago in a PHP web application. The code of "php-date-hours-ago.php" given below :

<?php
$currentDate=date('Y-m-d H:i:s');
echo "Current Date : ".$currentDate;
echo "<br>";
echo " date 2 hours ago : "; 
echo date("Y-m-d H:i:s", strtotime ("+2 hour"));
?>

Output :

When run "php-date-hours-ago.php" display output as :

Download Source Code

Go to Topic «PreviousHomeNext»

Your Comment:


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

 
Tutorial Topics