X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR BOOTSTRAP XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

PHP getdate() Function

PHP Date/Time PHP Date/Time Reference

Example

Return date/time information of the current local date/time:

<?php
print_r(getdate());
?>

Run example »

Definition and Usage

The getdate() function returns date/time information of a timestamp or the current local date/time.


Syntax

getdate(timestamp);

Parameter Description
timestamp Optional. Specifies an integer Unix timestamp. Default is the current local time (time())

Technical Details

Return Value: Returns an associative array with information related to the timestamp:
  • [seconds] - seconds
  • [minutes] - minutes
  • [hours] - hours
  • [mday] - day of the month
  • [wday] - day of the week
  • [mon] - month
  • [year] - year
  • [yday] - day of the year
  • [weekday] - name of the weekday
  • [month] - name of the month
  • [0] - seconds since Unix Epoch
PHP Version: 4+


PHP Date/Time PHP Date/Time Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook