# DatePart.class.php

Go to the documentation of this file.

    00001 <?php
    00002 /***************************************************************************
    00003  *   Copyright (C) 2007 by Konstantin V. Arkhipov                          *
    00004  *                                                                         *
    00005  *   This program is free software; you can redistribute it and/or modify  *
    00006  *   it under the terms of the GNU Lesser General Public License as        *
    00007  *   published by the Free Software Foundation; either version 3 of the    *
    00008  *   License, or (at your option) any later version.                       *
    00009  *                                                                         *
    00010  ***************************************************************************/
    00011
    00017     final class DatePart extends Enumeration
    00018     {
    00019         const CENTURY           = 1;
    00020         const DAY               = 2;
    00021         const DECADE            = 3;
    00022         const DOW               = 4; // day of week
    00023         const DOY               = 5; // day of year
    00024         const EPOCH             = 6;
    00025         const HOUR              = 7;
    00026         const MICROSECONDS      = 8;
    00027         const MILLENIUM         = 9; // damn useful
    00028         const MILLISECONDS      = 10;
    00029         const MINUTE            = 11;
    00030         const MONTH             = 12;
    00031         const QUARTER           = 13;
    00032         const SECOND            = 14;
    00033         const TIMEZONE          = 15;
    00034         const TIMEZONE_HOUR     = 16;
    00035         const TIMEZONE_MINUTE   = 17;
    00036         const WEEK              = 18;
    00037         const YEAR              = 19;
    00038
    00039         protected $names = array(
    00040             self::CENTURY           => 'CENTURY',
    00041             self::DAY               => 'DAY',
    00042             self::DECADE            => 'DECADE',
    00043             self::DOW               => 'DOW',
    00044             self::DOY               => 'DOY',
    00045             self::EPOCH             => 'EPOCH',
    00046             self::HOUR              => 'HOUR',
    00047             self::MICROSECONDS      => 'MICROSECONDS',
    00048             self::MILLENIUM         => 'MILLENIUM',
    00049             self::MILLISECONDS      => 'MILLISECONDS',
    00050             self::MINUTE            => 'MINUTE',
    00051             self::MONTH             => 'MONTH',
    00052             self::QUARTER           => 'QUARTER',
    00053             self::SECOND            => 'SECOND',
    00054             self::TIMEZONE          => 'TIMEZONE',
    00055             self::TIMEZONE_HOUR     => 'TIMEZONE_HOUR',
    00056             self::TIMEZONE_MINUTE   => 'TIMEZONE_MINUTE',
    00057             self::WEEK              => 'WEEK',
    00058             self::YEAR              => 'YEAR'
    00059         );
    00060     }
    00061 ?>