April 2026
Intermediate
1009 pages
34h 15m
English
PHP has several functions and, with DateTime, also an object to return and work with date values. This makes the whole thing a little confusing. To bring order into it, this section is organized according to different use cases.
The current date always refers to the date of the server in a server-side programming language such as PHP. You can have this date delivered using two very powerful functions:
getdate() returns the current date as an associative array.
date(Format) returns the current date in a format that you specify.
The third option is the DateTime object. It returns the date in object-oriented form (see next section).
Caution: If your server is located in Europe, ...
Read now
Unlock full access