Syntax
int idate ( string $format [, int $timestamp] ); |
Definition and Usage
Returns a number formatted according to the given format string using the given integer timestamp or the current local time if no timestamp is given. In other words, timestamp is optional and defaults to the value of time().
Paramters
Parameter | Description |
---|---|
format | Required. Specifies how to return the result:
|
timestamp | Optional. This is an integer Unix timestamp that defaults to the current local time if a timestamp is not given. In other words, it defaults to the value of time(). |
Return Value
Always returns an integer and as they can't start with a "0", idate() may return fewer digits than you would expect.
Example
Following is the usage of this function:
<?php $timestamp = strtotime('1st January 2004'); echo idate('y', $timestamp); echo"\n"; echo idate('t', $timestamp); ?> |
This will produce following result:
4 31 |
No comments:
Post a Comment