PHP: Getting the Current Date and Time

by Yang Yang on April 22, 2009

Share This Article:
Subscribe to Kavoir: blog feed

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()
Share This Article:
Subscribe to Kavoir: blog feed

You should also read:

Leave a Comment

Previous post:

Next post: