A Class for Validating and Formatting Dates
By Tony Marston2005-04-16
A Class for Validating and Formatting Dates
Intended Audience This tutorial is intended for developers who want to take a user-supplied date and format it so that it can be added to the database, and then to take a date from the database and format for display to the user.
Prerequisites
It is assumed you have basic knowledge of PHP. This tutorial will cover some of the following areas in PHP:
• Class/Object functions.
• Simple Array functions.
• Simple regular expressions.
• Date functions (checkdate, GregoriantoJD, JDtoGregorian).
• String functions (strtolower, ucfirst, strlen, substr, list, split).
Tutorial Pages:
» A Class for Validating and Formatting Dates
» Defining the Class to Handle Dates
» Display date to the User
» Incrementing or Decrementing a Date
» Using this Class in Your Code
» Summary
