PHP Object-Oriented Solutions
Chapter 3
This chapter gives an overview of using PHP's date-related classes and also guides creating a functional, reusable, user-friendly class for handling dates.
Exericses
- Examining the Built-in Date-related Classes
- The exercise uses the
ReflectionClass
constructor to view theDateTime
class. The code has been wrapped in<pre>
tags for readability. - Using the
DateTime
Class - The exercise displays different ways to use the
DateTime
class, as well as displaying some constants. - Examining the
DateTimeZone
class - The exercise uses the
ReflectionClass
constructor to view theDateTimeZone
class. The code has been wrapped in<pre>
tags for readability. - Using the
DateTimeZone
Class - the Exercise displays various time zones. The final two are coded in a better way to display multiple time zones at once.
- Using a custom
Date
Class - The page displays the various methods and functionalities of the class.