In this tutorial you will learn how to find PHP date to mktime in a PHP web application.
PHP date mktime
In this tutorial you will learn how to find PHP date to mktime in a PHP web application. The mktime() function use for specific date convert in timestamp. The Syntax of mktime () function
mktime(hour,minute,second,month,day,year,is_dst);
In this tutorial first date convert in timestamp and again timestamp to date . The code of "php-date-mktime.php" given below :
<?php $current_date=date("Y-m-d"); echo "Current Date : ".$current_date; echo "<br>"; $date_tmp = explode("-",$current_date); $mktime=mktime(0,0,0, $date_tmp[1], $date_tmp[2],$date_tmp[0]); echo "mktime : ".$mktime."<br>"; echo "date : ".date("Y-m-d", $mktime)."<br>"; echo date("M-d-Y", mktime(12, 15, 4, 10, 11, 2010)); ?>
Output :
When run "php-date-mktime.php" display output as :
[ 0 ] Comments