PHP getdate() function

Date function of PHP
PHP gettimeofday() function

In this article, you will learn how to get information about a timestamp. The getdate() function returns the date/time information of a timestamp. The timestamp can be replaced with current local date/time to get its information.

What is the syntax of the function in PHP?

getdate(timestamp)
ParameterDescription
timestampOptional. Specifies an integer Unix timestamp. Default is the current local time (time())
PHP getdate() function

Example of the function

Example 1. In this example, we simply get the date/time information of the current local time.

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

Date function of PHP
PHP gettimeofday() function
en English
X
Scroll to Top