PHP: Getting the Current Date and Time

Programmably, there are several different types of date and time in PHP you can create and process. Consequently, you have several types of current date and time in PHP that can be generated and used.

Below is a list of functions that returns the current date and time:

  1. The current Unix timestamp: time()
  2. The current date and time information returned as an array: getdate()
  3. The formatted locale string of current date and time: strftime()
  4. The formatted string of current date and time: time()
  5. The current local date and time values returned as an array: localtime()
Scroll to Top