PHP manipulates dates in a number of ways, using arrays, strings, Unix timestamps, or
DateTime objects. PHP provides a number of built-in functions for manipulating dates using these various data types.
- Creates a new DateTime object from a formatted date-time string.
- Takes a DateTime object and returns a string based on its formatted value.
- Creates a formatted date-time string from a local date-time.
- Returns an array representing the current date or a Unix timestamp.
- Returns current time measured in seconds from the Unix Epoch.
Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.