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)
Parameter | Description |
---|---|
timestamp | Optional. Specifies an integer Unix timestamp. Default is the current local time (time()) |
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());
?>