What is the use of mktime() function ?

The mktime() function is used to find the future particular date after specifying the time peroid.

Example :

<?php
// Return future date
$futureDate = mktime(0,0,0,date("m")+30,date("d"),date("Y"));
echo date("d/m/Y", $futureDate);
?>

Output :

14/01/2021

As from the above example , it the date is displayed which falls 30 months after from the current date . 

Leave a Reply

Your email address will not be published.Required fields are marked *