The idate() function formats a local time or date as integer. It returns a default value of time, if no timestamp is given otherwise it returns number formatted according to the given format string using the given integer timestamp or the current local time.
idate functions similar to function date() but it accepts just one char in the format parameter.
Syntax or Code of idate() Function PHP
int idate ( string $format [, int $timestamp= time() ] )
Parameter & Description of idate() in PHP
format - Format is an essential parameter. It returns the result according to specified parameter.
timestamp - It is optional and returns the result in the formatted form if date or time is specified or it returns the default timestamp.
Example of idate() in PHP:
<?php
echo(idate("Y"));
?>
The output of the code above could be:
2006
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.