Chapter 11. Working with Dates and Times

Dates are so much a part of everyday life that it becomes easy to work with them without thinking. However, the quirks of the Gregorian calendar can be difficult to work with in programs. Fortunately, PHP provides powerful tools for date arithmetic that make date manipulation an easy task. Similarly, MySQL comes with its own set of date-related functions. You learn about these in this hour as well, and find that MySQL can take a lot of the programming burden off your hands.

In this hour, you will learn

  • How to acquire the current date and time

  • How to get information about a date

  • How to format date information

  • How to test dates for validity

  • How to set dates

  • How to use MySQL’s date and time-related functions

  • How to ...

Get Sams Teach Yourself PHP, MySQL™ and Apache in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.