PHP Tips & Tutorials

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()

By Yang Yang

Hello, I'm Yang. I build online businesses that please people. Want to join in and post some useful articles on Shoot me a message.