Chapter 6. Xyster_Date

Table of Contents

6.1. Overview
6.1.1. Xyster_Date_Range

6.1. Overview

This package contains extensions to the Zend Framework Date package.

For more information about the use of the date classes, see the Zend Framework documentation for Zend_Date.

6.1.1. Xyster_Date_Range

This class gives you the ability to specify a range of two dates. You can calculate the timespan between them and see if a given date is within this range.

<?php
$start = new Zend_Date(strtotime('-90 days'));
$end = new Zend_Date(); // right now
$range = new Xyster_Date_Range($start, $end);
$within = new Zend_Date('-60 days');
if ( $range->isWithin($within) ) {
    // do something here
}