Complete PHP Date Reference
The mktime() function returns the Unix timestamp for a date.
This timestamp contains the number of seconds between the Unix Epoch (January 1 1970 00:00:00 GMT) and the time specified.
| Parameter | Description |
|---|---|
| hour | Optional. Specifies the hour |
| minute | Optional. Specifies the minute |
| second | Optional. Specifies the second |
| month | Optional. Specifies the numerical month |
| day | Optional. Specifies the day |
| year | Optional. Specifies the year. The valid range for year is on some systems between 1901 and 2038. However this limitation is overcome in PHP 5 |
| is_dst | Optional. Set this parameter to 1 if the time is during daylight savings time (DST), 0 if it is not, or -1 (the default) if it is unknown. If it's unknown, PHP tries to find out itself (which may cause unexpected results). Note: This parameter became deprecated in PHP 5. The new timezone handling features should be used instead. |
Note: If the arguments are invalid, the function returns false (PHP versions before 5.1 returns -1).
The mktime() function is useful for doing date arithmetic and validation. It will automatically calculate the correct value for out-of-range input:
The output of the code above would be:
Complete PHP Date Reference
| WEB HOSTING |
|---|
| Best Web Hosting |
| PHP MySQL Hosting |
| Best Hosting Coupons |
| UK Reseller Hosting |
| Cloud Hosting |
| Top Web Hosting |
| $7.95/mo SEO Hosting |
| Premium Website Design |
| WEB BUILDING |
|---|
| XML Editor - Free Trial! |
| FREE Website BUILDER |
| Free Website Templates Free CSS Templates |
| Make Your Own Website |
| W3SCHOOLS EXAMS |
|---|
|
Get Certified in: HTML, CSS, JavaScript, XML, PHP, and ASP |
| W3SCHOOLS BOOKS |
|---|
|
New Books: HTML, CSS JavaScript, and Ajax |
| STATISTICS |
|---|
|
Browser Statistics Browser OS Browser Display |
| SHARE THIS PAGE |
|---|