A Class for Validating and Formatting Dates

by Tony Marston
TonyMarston.net
Friday, 19th May 2006
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).


Options:
Printer Friendly
Email Friend

About The Author:

I have been a software engineer, both designing and developing, since 1977. I have worked with a variety of 2nd, 3rd and 4th generation languages on a mixture of mainframes, mini- and micro-computers. I have worked with flat files, indexed files, hierarchical databases, network databases and relational databases. The user interfaces have included punched card, paper tape, teletype, block mode, CHUI, GUI and web. I have written code which has been procedural, model-driven, event-driven, component-based and object oriented. I have built software using the 1-tier, 2-tier, 3-tier and Model-View-Controller (MVC) architectures. After working with COBOL for 16 years I switched to UNIFACE in 1993, starting with version 5, then progressing through version 6 to version 7. In the middle of 2002 I decided to teach myself to develop web applications using PHP and MySQL.

Developer Categories



Developer Tutorials
ASP
CGI & Perl
CSS
Flash
HTML
Java
JavaScript
MySQL
PHP
Python
XML

Developer Documentation

Developer Tools



Search our Developer Tutorials
  The DevSyndicate Network