PHP idate

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

PHP : idate() function

Description

The idate() function is used to get a local time/date format as an integer.

Version

(PHP 4 and above)

Syntax

idate(format, timestamp) 

Parameters

Name

Description

Required /
Optional

Type

format

B - Swatch Beat/Internet Time
d - Day of the month
h - Hour (12-hour format)
H - Hour (24-hour format)
i - Minutes
I - returns 1 when DST is activated otherwise 0
L - returns 1 for leap year otherwise 0
m - Month number
s - Seconds
t - Days in current month
U - Seconds since the Unix Epoch - January 1 1970 00:00:00 UTC
w - Day of the week (0 on Sunday)
W - ISO-8601 numeric week of year, weeks starting on Monday
y - Year
Y - Year in 4 digits
z - Day of the year
Z - Timezone offset in seconds

Optional

String

timestamp

An integer indicates the unixtimestamp. If a timestamp is not supplied, it gives the current local time.

Optional

integer

 

Return value

An integer value.

Value Type : Integer.

Example :

  1. echo idate('d');  

  2. ?>   

Output :

19