Date and Time Function

Date and Time Function:
To keep track of the date and time, PHP uses standard Unix timestamps, which are simply the number of seconds since the start of January 1,1970.you can use the time function.
echo time();
WE can also use a time function to check the current date by using the function
checkdate();

For example:
<?php 
$month =9;   //september(only has 30 days)
$day=31; //31st
$year =2019 //2019
if(checkdate($month,$day,$year)) echo "Date is valid";
else echo "Date is invalid";
?>
Translate »