PHP date in seconds

PHP date in seconds


Posted in : PHP Posted on : January 27, 2011 at 6:58 PM Comments : [ 0 ]

In this tutorial you will learn how to find PHP date in seconds in a PHP web application.

PHP date in seconds

In this tutorial you will learn how to find PHP date in seconds  in a PHP web application. In this tutorial  $date variable that store current date that convert in seconds and again seconds also convert in date format. The code of  "php-date-in-seconds.php" given below : 

<?php
$date=date('Y-m-d H:i:s');
echo "Current Date : ".$date;
echo "<br>";
echo "Date in seconds : ";
$strtotime=strtotime(date($date));
echo $strtotime;
echo "<br>";
echo "Date : ".date ('Y-m-d H:i:s',strtotime(date($date)))
?>

Output :

When run "php-date-in-seconds.php" display output as :

Download Source Code

Go to Topic «PreviousHomeNext»

Your Comment:


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

 
Tutorial Topics