Summary

In this hour, you learned how to use time() to get a date stamp for the current date and time. You learned how to use getdate() to extract date information from a timestamp and date() to convert a timestamp into a formatted string. You also learned how to create a timestamp using mktime() and how to test a date for validity with checkdate(). You worked through an example script, which applies some of the tools you have looked at, and built a class library that automates some of the more tedious aspects of working with dates in forms.

Get Sams Teach Yourself PHP in 24 Hours, Third Edition 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.