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 :


[ 0 ] Comments