* @copyright 1999-2006 Monte Ohrt, Pierre-Alain Joye, Daniel Convissor
* @license http://www.opensource.org/licenses/bsd-license.php
* BSD License
* @version Release: 1.4.7
* @link http://pear.php.net/package/Date
* @since Class available since Release 1.2
*/
class Date_Calc
{
// {{{ dateFormat()
/**
* Formats the date in the given format, much like strfmt()
*
* This function is used to alleviate the problem with 32-bit numbers for
* dates pre 1970 or post 2038, as strfmt() has on most systems.
* Most of the formatting options are compatible.
*
* Formatting options:
*
* %a abbreviated weekday name (Sun, Mon, Tue)
* %A full weekday name (Sunday, Monday, Tuesday)
* %b abbreviated month name (Jan, Feb, Mar)
* %B full month name (January, February, March)
* %d day of month (range 00 to 31)
* %e day of month, single digit (range 0 to 31)
* %E number of days since unspecified epoch (integer)
* (%E is useful for passing a date in a URL as
* an integer value. Then simply use
* daysToDate() to convert back to a date.)
* %j day of year (range 001 to 366)
* %m month as decimal number (range 1 to 12)
* %n newline character (\n)
* %t tab character (\t)
* %w weekday as decimal (0 = Sunday)
* %U week number of current year, first sunday as first week
* %y year as decimal (range 00 to 99)
* %Y year as decimal including century (range 0000 to 9999)
* %% literal '%'
*
*
* @param int $day the day of the month
* @param int $month the month
* @param int $year the year. Use the complete year instead of the
* abbreviated version. E.g. use 2005, not 05.
* Do not add leading 0's for years prior to 1000.
* @param string $format the format string
*
* @return string the date in the desired format
*
* @access public
* @static
*/
function dateFormat($day, $month, $year, $format)
{
if (!Date_Calc::isValidDate($day, $month, $year)) {
$year = Date_Calc::dateNow('%Y');
$month = Date_Calc::dateNow('%m');
$day = Date_Calc::dateNow('%d');
}
$output = '';
for ($strpos = 0; $strpos < strlen($format); $strpos++) {
$char = substr($format, $strpos, 1);
if ($char == '%') {
$nextchar = substr($format, $strpos + 1, 1);
switch($nextchar) {
case 'a':
$output .= Date_Calc::getWeekdayAbbrname($day, $month, $year);
break;
case 'A':
$output .= Date_Calc::getWeekdayFullname($day, $month, $year);
break;
case 'b':
$output .= Date_Calc::getMonthAbbrname($month);
break;
case 'B':
$output .= Date_Calc::getMonthFullname($month);
break;
case 'd':
$output .= sprintf('%02d', $day);
break;
case 'e':
$output .= $day;
break;
case 'E':
$output .= Date_Calc::dateToDays($day, $month, $year);
break;
case 'j':
$output .= Date_Calc::julianDate($day, $month, $year);
break;
case 'm':
$output .= sprintf('%02d', $month);
break;
case 'n':
$output .= "\n";
break;
case 't':
$output .= "\t";
break;
case 'w':
$output .= Date_Calc::dayOfWeek($day, $month, $year);
break;
case 'U':
$output .= Date_Calc::weekOfYear($day, $month, $year);
break;
case 'y':
$output .= substr($year, 2, 2);
break;
case 'Y':
$output .= $year;
break;
case '%':
$output .= '%';
break;
default:
$output .= $char.$nextchar;
}
$strpos++;
} else {
$output .= $char;
}
}
return $output;
}
// }}}
// {{{ defaultCentury()
/**
* Turns a two digit year into a four digit year
*
* From '51 to '99 is in the 1900's, otherwise it's in the 2000's.
*
* @param int $year the 2 digit year
*
* @return string the 4 digit year
*
* @access public
* @static
*/
function defaultCentury($year)
{
if (strlen($year) == 1) {
$year = '0' . $year;
}
if ($year > 50) {
return '19' . $year;
} else {
return '20' . $year;
}
}
// }}}
// {{{ dateToDays()
/**
* Converts a date to number of days since a distant unspecified epoch
*
* @param int $day the day of the month
* @param int $month the month
* @param int $year the year. Use the complete year instead of the
* abbreviated version. E.g. use 2005, not 05.
* Do not add leading 0's for years prior to 1000.
*
* @return integer the number of days since the Date_Calc epoch
*
* @access public
* @static
*/
function dateToDays($day, $month, $year)
{
$century = (int)substr($year, 0, 2);
$year = (int)substr($year, 2, 2);
if ($month > 2) {
$month -= 3;
} else {
$month += 9;
if ($year) {
$year--;
} else {
$year = 99;
$century --;
}
}
return (floor((146097 * $century) / 4 ) +
floor((1461 * $year) / 4 ) +
floor((153 * $month + 2) / 5 ) +
$day + 1721119);
}
// }}}
// {{{ daysToDate()
/**
* Converts number of days to a distant unspecified epoch
*
* @param int $days the number of days since the Date_Calc epoch
* @param string $format the string indicating how to format the output
*
* @return string the date in the desired format
*
* @access public
* @static
*/
function daysToDate($days, $format = DATE_CALC_FORMAT)
{
$days -= 1721119;
$century = floor((4 * $days - 1) / 146097);
$days = floor(4 * $days - 1 - 146097 * $century);
$day = floor($days / 4);
$year = floor((4 * $day + 3) / 1461);
$day = floor(4 * $day + 3 - 1461 * $year);
$day = floor(($day + 4) / 4);
$month = floor((5 * $day - 3) / 153);
$day = floor(5 * $day - 3 - 153 * $month);
$day = floor(($day + 5) / 5);
if ($month < 10) {
$month +=3;
} else {
$month -=9;
if ($year++ == 99) {
$year = 0;
$century++;
}
}
$century = sprintf('%02d', $century);
$year = sprintf('%02d', $year);
return Date_Calc::dateFormat($day, $month, $century . $year, $format);
}
// }}}
// {{{ gregorianToISO()
/**
* Converts from Gregorian Year-Month-Day to ISO Year-WeekNumber-WeekDay
*
* Uses ISO 8601 definitions. Algorithm by Rick McCarty, 1999 at
* http://personal.ecu.edu/mccartyr/ISOwdALG.txt .
* Transcribed to PHP by Jesus M. Castagnetto.
*
* @param int $day the day of the month
* @param int $month the month
* @param int $year the year. Use the complete year instead of the
* abbreviated version. E.g. use 2005, not 05.
* Do not add leading 0's for years prior to 1000.
*
* @return string the date in ISO Year-WeekNumber-WeekDay format
*
* @access public
* @static
*/
function gregorianToISO($day, $month, $year)
{
$mnth = array (0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334);
$y_isleap = Date_Calc::isLeapYear($year);
$y_1_isleap = Date_Calc::isLeapYear($year - 1);
$day_of_year_number = $day + $mnth[$month - 1];
if ($y_isleap && $month > 2) {
$day_of_year_number++;
}
// find Jan 1 weekday (monday = 1, sunday = 7)
$yy = ($year - 1) % 100;
$c = ($year - 1) - $yy;
$g = $yy + intval($yy / 4);
$jan1_weekday = 1 + intval((((($c / 100) % 4) * 5) + $g) % 7);
// weekday for year-month-day
$h = $day_of_year_number + ($jan1_weekday - 1);
$weekday = 1 + intval(($h - 1) % 7);
// find if Y M D falls in YearNumber Y-1, WeekNumber 52 or
if ($day_of_year_number <= (8 - $jan1_weekday) && $jan1_weekday > 4){
$yearnumber = $year - 1;
if ($jan1_weekday == 5 || ($jan1_weekday == 6 && $y_1_isleap)) {
$weeknumber = 53;
} else {
$weeknumber = 52;
}
} else {
$yearnumber = $year;
}
// find if Y M D falls in YearNumber Y+1, WeekNumber 1
if ($yearnumber == $year) {
if ($y_isleap) {
$i = 366;
} else {
$i = 365;
}
if (($i - $day_of_year_number) < (4 - $weekday)) {
$yearnumber++;
$weeknumber = 1;
}
}
// find if Y M D falls in YearNumber Y, WeekNumber 1 through 53
if ($yearnumber == $year) {
$j = $day_of_year_number + (7 - $weekday) + ($jan1_weekday - 1);
$weeknumber = intval($j / 7);
if ($jan1_weekday > 4) {
$weeknumber--;
}
}
// put it all together
if ($weeknumber < 10) {
$weeknumber = '0'.$weeknumber;
}
return $yearnumber . '-' . $weeknumber . '-' . $weekday;
}
// }}}
// {{{ dateSeason()
/**
* Determines julian date of the given season
*
* Adapted from previous work in Java by James Mark Hamilton.
*
* @param string $season the season to get the date for: VERNALEQUINOX,
* SUMMERSOLSTICE, AUTUMNALEQUINOX,
* or WINTERSOLSTICE
* @param string $year the year in four digit format. Must be between
* -1000BC and 3000AD.
*
* @return float the julian date the season starts on
*
* @author James Mark Hamilton
* @author Robert Butler
* @access public
* @static
*/
function dateSeason($season, $year = 0)
{
if ($year == '') {
$year = Date_Calc::dateNow('%Y');
}
if (($year >= -1000) && ($year <= 1000)) {
$y = $year / 1000.0;
switch ($season) {
case 'VERNALEQUINOX':
$juliandate = (((((((-0.00071 * $y) - 0.00111) * $y) + 0.06134) * $y) + 365242.1374) * $y) + 1721139.29189;
break;
case 'SUMMERSOLSTICE':
$juliandate = (((((((0.00025 * $y) + 0.00907) * $y) - 0.05323) * $y) + 365241.72562) * $y) + 1721233.25401;
break;
case 'AUTUMNALEQUINOX':
$juliandate = (((((((0.00074 * $y) - 0.00297) * $y) - 0.11677) * $y) + 365242.49558) * $y) + 1721325.70455;
break;
case 'WINTERSOLSTICE':
default:
$juliandate = (((((((-0.00006 * $y) - 0.00933) * $y) - 0.00769) * $y) + 365242.88257) * $y) + 1721414.39987;
}
} elseif (($year > 1000) && ($year <= 3000)) {
$y = ($year - 2000) / 1000;
switch ($season) {
case 'VERNALEQUINOX':
$juliandate = (((((((-0.00057 * $y) - 0.00411) * $y) + 0.05169) * $y) + 365242.37404) * $y) + 2451623.80984;
break;
case 'SUMMERSOLSTICE':
$juliandate = (((((((-0.0003 * $y) + 0.00888) * $y) + 0.00325) * $y) + 365241.62603) * $y) + 2451716.56767;
break;
case 'AUTUMNALEQUINOX':
$juliandate = (((((((0.00078 * $y) + 0.00337) * $y) - 0.11575) * $y) + 365242.01767) * $y) + 2451810.21715;
break;
case 'WINTERSOLSTICE':
default:
$juliandate = (((((((0.00032 * $y) - 0.00823) * $y) - 0.06223) * $y) + 365242.74049) * $y) + 2451900.05952;
}
}
return $juliandate;
}
// }}}
// {{{ dateNow()
/**
* Returns the current local date
*
* NOTE: This function retrieves the local date using strftime(),
* which may or may not be 32-bit safe on your system.
*
* @param string $format the string indicating how to format the output
*
* @return string the current date in the specified format
*
* @access public
* @static
*/
function dateNow($format = DATE_CALC_FORMAT)
{
return strftime($format, time());
}
// }}}
// {{{ getYear()
/**
* Returns the current local year in format CCYY
*
* @return string the current year in four digit format
*
* @access public
* @static
*/
function getYear()
{
return Date_Calc::dateNow('%Y');
}
// }}}
// {{{ getMonth()
/**
* Returns the current local month in format MM
*
* @return string the current month in two digit format
*
* @access public
* @static
*/
function getMonth()
{
return Date_Calc::dateNow('%m');
}
// }}}
// {{{ getDay()
/**
* Returns the current local day in format DD
*
* @return string the current day of the month in two digit format
*
* @access public
* @static
*/
function getDay()
{
return Date_Calc::dateNow('%d');
}
// }}}
// {{{ julianDate()
/**
* Returns number of days since 31 December of year before given date
*
* @param int $day the day of the month, default is current local day
* @param int $month the month, default is current local month
* @param int $year the year in four digit format, default is current local year
*
* @return int the julian date for the date
*
* @access public
* @static
*/
function julianDate($day = 0, $month = 0, $year = 0)
{
if (empty($year)) {
$year = Date_Calc::dateNow('%Y');
}
if (empty($month)) {
$month = Date_Calc::dateNow('%m');
}
if (empty($day)) {
$day = Date_Calc::dateNow('%d');
}
$days = array(0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334);
$julian = ($days[$month - 1] + $day);
if ($month > 2 && Date_Calc::isLeapYear($year)) {
$julian++;
}
return $julian;
}
// }}}
// {{{ getWeekdayFullname()
/**
* Returns the full weekday name for the given date
*
* @param int $day the day of the month, default is current local day
* @param int $month the month, default is current local month
* @param int $year the year in four digit format, default is current local year
*
* @return string the full name of the day of the week
*
* @access public
* @static
*/
function getWeekdayFullname($day = 0, $month = 0, $year = 0)
{
if (empty($year)) {
$year = Date_Calc::dateNow('%Y');
}
if (empty($month)) {
$month = Date_Calc::dateNow('%m');
}
if (empty($day)) {
$day = Date_Calc::dateNow('%d');
}
$weekday_names = Date_Calc::getWeekDays();
$weekday = Date_Calc::dayOfWeek($day, $month, $year);
return $weekday_names[$weekday];
}
// }}}
// {{{ getWeekdayAbbrname()
/**
* Returns the abbreviated weekday name for the given date
*
* @param int $day the day of the month, default is current local day
* @param int $month the month, default is current local month
* @param int $year the year in four digit format, default is current local year
* @param int $length the length of abbreviation
*
* @return string the abbreviated name of the day of the week
*
* @access public
* @static
* @see Date_Calc::getWeekdayFullname()
*/
function getWeekdayAbbrname($day = 0, $month = 0, $year = 0, $length = 3)
{
if (empty($year)) {
$year = Date_Calc::dateNow('%Y');
}
if (empty($month)) {
$month = Date_Calc::dateNow('%m');
}
if (empty($day)) {
$day = Date_Calc::dateNow('%d');
}
return substr(Date_Calc::getWeekdayFullname($day, $month, $year),
0, $length);
}
// }}}
// {{{ getMonthFullname()
/**
* Returns the full month name for the given month
*
* @param int $month the month
*
* @return string the full name of the month
*
* @access public
* @static
*/
function getMonthFullname($month)
{
$month = (int)$month;
if (empty($month)) {
$month = (int)Date_Calc::dateNow('%m');
}
$month_names = Date_Calc::getMonthNames();
return $month_names[$month];
}
// }}}
// {{{ getMonthAbbrname()
/**
* Returns the abbreviated month name for the given month
*
* @param int $month the month
* @param int $length the length of abbreviation
*
* @return string the abbreviated name of the month
*
* @access public
* @static
* @see Date_Calc::getMonthFullname
*/
function getMonthAbbrname($month, $length = 3)
{
$month = (int)$month;
if (empty($month)) {
$month = Date_Calc::dateNow('%m');
}
return substr(Date_Calc::getMonthFullname($month), 0, $length);
}
// }}}
// {{{ getMonthFromFullname()
/**
* Returns the numeric month from the month name or an abreviation
*
* Both August and Aug would return 8.
*
* @param string $month the name of the month to examine.
* Case insensitive.
*
* @return integer the month's number
*
* @access public
* @static
*/
function getMonthFromFullName($month)
{
$month = strtolower($month);
$months = Date_Calc::getMonthNames();
while(list($id, $name) = each($months)) {
if (ereg($month, strtolower($name))) {
return $id;
}
}
return 0;
}
// }}}
// {{{ getMonthNames()
/**
* Returns an array of month names
*
* Used to take advantage of the setlocale function to return
* language specific month names.
*
* TODO: cache values to some global array to avoid preformace
* hits when called more than once.
*
* @returns array an array of month names
*
* @access public
* @static
*/
function getMonthNames()
{
$months = array();
for ($i = 1; $i < 13; $i++) {
$months[$i] = strftime('%B', mktime(0, 0, 0, $i, 1, 2001));
}
return $months;
}
// }}}
// {{{ getWeekDays()
/**
* Returns an array of week days
*
* Used to take advantage of the setlocale function to
* return language specific week days.
*
* TODO: cache values to some global array to avoid preformace
* hits when called more than once.
*
* @returns array an array of week day names
*
* @access public
* @static
*/
function getWeekDays()
{
$weekdays = array();
for ($i = 0; $i < 7; $i++) {
$weekdays[$i] = strftime('%A', mktime(0, 0, 0, 1, $i, 2001));
}
return $weekdays;
}
// }}}
// {{{ dayOfWeek()
/**
* Returns day of week for given date (0 = Sunday)
*
* @param int $day the day of the month, default is current local day
* @param int $month the month, default is current local month
* @param int $year the year in four digit format, default is current local year
*
* @return int the number of the day in the week
*
* @access public
* @static
*/
function dayOfWeek($day = 0, $month = 0, $year = 0)
{
if (empty($year)) {
$year = Date_Calc::dateNow('%Y');
}
if (empty($month)) {
$month = Date_Calc::dateNow('%m');
}
if (empty($day)) {
$day = Date_Calc::dateNow('%d');
}
if ($month > 2) {
$month -= 2;
} else {
$month += 10;
$year--;
}
$day = (floor((13 * $month - 1) / 5) +
$day + ($year % 100) +
floor(($year % 100) / 4) +
floor(($year / 100) / 4) - 2 *
floor($year / 100) + 77);
$weekday_number = $day - 7 * floor($day / 7);
return $weekday_number;
}
// }}}
// {{{ weekOfYear()
/**
* Returns week of the year, first Sunday is first day of first week
*
* @param int $day the day of the month, default is current local day
* @param int $month the month, default is current local month
* @param int $year the year in four digit format, default is current local year
*
* @return int the number of the week in the year
*
* @access public
* @static
*/
function weekOfYear($day = 0, $month = 0, $year = 0)
{
if (empty($year)) {
$year = Date_Calc::dateNow('%Y');
}
if (empty($month)) {
$month = Date_Calc::dateNow('%m');
}
if (empty($day)) {
$day = Date_Calc::dateNow('%d');
}
$iso = Date_Calc::gregorianToISO($day, $month, $year);
$parts = explode('-', $iso);
$week_number = intval($parts[1]);
return $week_number;
}
// }}}
// {{{ quarterOfYear()
/**
* Returns quarter of the year for given date
*
* @param int $day the day of the month, default is current local day
* @param int $month the month, default is current local month
* @param int $year the year in four digit format, default is current local year
*
* @return int the number of the quarter in the year
*
* @access public
* @static
*/
function quarterOfYear($day = 0, $month = 0, $year = 0)
{
if (empty($year)) {
$year = Date_Calc::dateNow('%Y');
}
if (empty($month)) {
$month = Date_Calc::dateNow('%m');
}
if (empty($day)) {
$day = Date_Calc::dateNow('%d');
}
$year_quarter = intval(($month - 1) / 3 + 1);
return $year_quarter;
}
// }}}
// {{{ daysInMonth()
/**
* Find the number of days in the given month
*
* @param int $month the month, default is current local month
* @param int $year the year in four digit format, default is current local year
*
* @return int the number of days the month has
*
* @access public
* @static
*/
function daysInMonth($month = 0, $year = 0)
{
if (empty($year)) {
$year = Date_Calc::dateNow('%Y');
}
if (empty($month)) {
$month = Date_Calc::dateNow('%m');
}
if ($year == 1582 && $month == 10) {
return 21; // October 1582 only had 1st-4th and 15th-31st
}
if ($month == 2) {
if (Date_Calc::isLeapYear($year)) {
return 29;
} else {
return 28;
}
} elseif ($month == 4 or $month == 6 or $month == 9 or $month == 11) {
return 30;
} else {
return 31;
}
}
// }}}
// {{{ weeksInMonth()
/**
* Returns the number of rows on a calendar month
*
* Useful for determining the number of rows when displaying a typical
* month calendar.
*
* @param int $month the month, default is current local month
* @param int $year the year in four digit format, default is current local year
*
* @return int the number of weeks the month has
*
* @access public
* @static
*/
function weeksInMonth($month = 0, $year = 0)
{
if (empty($year)) {
$year = Date_Calc::dateNow('%Y');
}
if (empty($month)) {
$month = Date_Calc::dateNow('%m');
}
$FDOM = Date_Calc::firstOfMonthWeekday($month, $year);
if (DATE_CALC_BEGIN_WEEKDAY==1 && $FDOM==0) {
$first_week_days = 7 - $FDOM + DATE_CALC_BEGIN_WEEKDAY;
$weeks = 1;
} elseif (DATE_CALC_BEGIN_WEEKDAY==0 && $FDOM == 6) {
$first_week_days = 7 - $FDOM + DATE_CALC_BEGIN_WEEKDAY;
$weeks = 1;
} else {
$first_week_days = DATE_CALC_BEGIN_WEEKDAY - $FDOM;
$weeks = 0;
}
$first_week_days %= 7;
return ceil((Date_Calc::daysInMonth($month, $year)
- $first_week_days) / 7) + $weeks;
}
// }}}
// {{{ getCalendarWeek()
/**
* Return an array with days in week
*
* @param int $day the day of the month, default is current local day
* @param int $month the month, default is current local month
* @param int $year the year in four digit format, default is current local year
* @param string $format the string indicating how to format the output
*
* @return array $week[$weekday]
*
* @access public
* @static
*/
function getCalendarWeek($day = 0, $month = 0, $year = 0,
$format = DATE_CALC_FORMAT)
{
if (empty($year)) {
$year = Date_Calc::dateNow('%Y');
}
if (empty($month)) {
$month = Date_Calc::dateNow('%m');
}
if (empty($day)) {
$day = Date_Calc::dateNow('%d');
}
$week_array = array();
// date for the column of week
$curr_day = Date_Calc::beginOfWeek($day, $month, $year,'%E');
for ($counter = 0; $counter <= 6; $counter++) {
$week_array[$counter] = Date_Calc::daysToDate($curr_day, $format);
$curr_day++;
}
return $week_array;
}
// }}}
// {{{ getCalendarMonth()
/**
* Return a set of arrays to construct a calendar month for the given date
*
* @param int $month the month, default is current local month
* @param int $year the year in four digit format, default is current local year
* @param string $format the string indicating how to format the output
*
* @return array $month[$row][$col]
*
* @access public
* @static
*/
function getCalendarMonth($month = 0, $year = 0,
$format = DATE_CALC_FORMAT)
{
if (empty($year)) {
$year = Date_Calc::dateNow('%Y');
}
if (empty($month)) {
$month = Date_Calc::dateNow('%m');
}
$month_array = array();
// date for the first row, first column of calendar month
if (DATE_CALC_BEGIN_WEEKDAY == 1) {
if (Date_Calc::firstOfMonthWeekday($month, $year) == 0) {
$curr_day = Date_Calc::dateToDays('01', $month, $year) - 6;
} else {
$curr_day = Date_Calc::dateToDays('01', $month, $year)
- Date_Calc::firstOfMonthWeekday($month, $year) + 1;
}
} else {
$curr_day = (Date_Calc::dateToDays('01', $month, $year)
- Date_Calc::firstOfMonthWeekday($month, $year));
}
// number of days in this month
$daysInMonth = Date_Calc::daysInMonth($month, $year);
$weeksInMonth = Date_Calc::weeksInMonth($month, $year);
for ($row_counter = 0; $row_counter < $weeksInMonth; $row_counter++) {
for ($column_counter = 0; $column_counter <= 6; $column_counter++) {
$month_array[$row_counter][$column_counter] =
Date_Calc::daysToDate($curr_day , $format);
$curr_day++;
}
}
return $month_array;
}
// }}}
// {{{ getCalendarYear()
/**
* Return a set of arrays to construct a calendar year for the given date
*
* @param int $year the year in four digit format, default current local year
* @param string $format the string indicating how to format the output
*
* @return array $year[$month][$row][$col]
*
* @access public
* @static
*/
function getCalendarYear($year = 0, $format = DATE_CALC_FORMAT)
{
if (empty($year)) {
$year = Date_Calc::dateNow('%Y');
}
$year_array = array();
for ($curr_month = 0; $curr_month <= 11; $curr_month++) {
$year_array[$curr_month] =
Date_Calc::getCalendarMonth($curr_month + 1,
$year, $format);
}
return $year_array;
}
// }}}
// {{{ prevDay()
/**
* Returns date of day before given date
*
* @param int $day the day of the month, default is current local day
* @param int $month the month, default is current local month
* @param int $year the year in four digit format, default is current local year
* @param string $format the string indicating how to format the output
*
* @return string the date in the desired format
*
* @access public
* @static
*/
function prevDay($day = 0, $month = 0, $year = 0,
$format = DATE_CALC_FORMAT)
{
if (empty($year)) {
$year = Date_Calc::dateNow('%Y');
}
if (empty($month)) {
$month = Date_Calc::dateNow('%m');
}
if (empty($day)) {
$day = Date_Calc::dateNow('%d');
}
$days = Date_Calc::dateToDays($day, $month, $year);
return Date_Calc::daysToDate($days - 1, $format);
}
// }}}
// {{{ nextDay()
/**
* Returns date of day after given date
*
* @param int $day the day of the month, default is current local day
* @param int $month the month, default is current local month
* @param int $year the year in four digit format, default is current local year
* @param string $format the string indicating how to format the output
*
* @return string the date in the desired format
*
* @access public
* @static
*/
function nextDay($day = 0, $month = 0, $year = 0,
$format = DATE_CALC_FORMAT)
{
if (empty($year)) {
$year = Date_Calc::dateNow('%Y');
}
if (empty($month)) {
$month = Date_Calc::dateNow('%m');
}
if (empty($day)) {
$day = Date_Calc::dateNow('%d');
}
$days = Date_Calc::dateToDays($day, $month, $year);
return Date_Calc::daysToDate($days + 1, $format);
}
// }}}
// {{{ prevWeekday()
/**
* Returns date of the previous weekday, skipping from Monday to Friday
*
* @param int $day the day of the month, default is current local day
* @param int $month the month, default is current local month
* @param int $year the year in four digit format, default is current local year
* @param string $format the string indicating how to format the output
*
* @return string the date in the desired format
*
* @access public
* @static
*/
function prevWeekday($day = 0, $month = 0, $year = 0,
$format = DATE_CALC_FORMAT)
{
if (empty($year)) {
$year = Date_Calc::dateNow('%Y');
}
if (empty($month)) {
$month = Date_Calc::dateNow('%m');
}
if (empty($day)) {
$day = Date_Calc::dateNow('%d');
}
$days = Date_Calc::dateToDays($day, $month, $year);
if (Date_Calc::dayOfWeek($day, $month, $year) == 1) {
$days -= 3;
} elseif (Date_Calc::dayOfWeek($day, $month, $year) == 0) {
$days -= 2;
} else {
$days -= 1;
}
return Date_Calc::daysToDate($days, $format);
}
// }}}
// {{{ nextWeekday()
/**
* Returns date of the next weekday of given date, skipping from
* Friday to Monday
*
* @param int $day the day of the month, default is current local day
* @param int $month the month, default is current local month
* @param int $year the year in four digit format, default is current local year
* @param string $format the string indicating how to format the output
*
* @return string the date in the desired format
*
* @access public
* @static
*/
function nextWeekday($day = 0, $month = 0, $year = 0,
$format = DATE_CALC_FORMAT)
{
if (empty($year)) {
$year = Date_Calc::dateNow('%Y');
}
if (empty($month)) {
$month = Date_Calc::dateNow('%m');
}
if (empty($day)) {
$day = Date_Calc::dateNow('%d');
}
$days = Date_Calc::dateToDays($day, $month, $year);
if (Date_Calc::dayOfWeek($day, $month, $year) == 5) {
$days += 3;
} elseif (Date_Calc::dayOfWeek($day, $month, $year) == 6) {
$days += 2;
} else {
$days += 1;
}
return Date_Calc::daysToDate($days, $format);
}
// }}}
// {{{ prevDayOfWeek()
/**
* Returns date of the previous specific day of the week
* from the given date
*
* @param int day of week, 0=Sunday
* @param int $day the day of the month, default is current local day
* @param int $month the month, default is current local month
* @param int $year the year in four digit format, default is current local year
* @param bool $onOrBefore if true and days are same, returns current day
* @param string $format the string indicating how to format the output
*
* @return string the date in the desired format
*
* @access public
* @static
*/
function prevDayOfWeek($dow, $day = 0, $month = 0, $year = 0,
$format = DATE_CALC_FORMAT, $onOrBefore = false)
{
if (empty($year)) {
$year = Date_Calc::dateNow('%Y');
}
if (empty($month)) {
$month = Date_Calc::dateNow('%m');
}
if (empty($day)) {
$day = Date_Calc::dateNow('%d');
}
$days = Date_Calc::dateToDays($day, $month, $year);
$curr_weekday = Date_Calc::dayOfWeek($day, $month, $year);
if ($curr_weekday == $dow) {
if (!$onOrBefore) {
$days -= 7;
}
} elseif ($curr_weekday < $dow) {
$days -= 7 - ($dow - $curr_weekday);
} else {
$days -= $curr_weekday - $dow;
}
return Date_Calc::daysToDate($days, $format);
}
// }}}
// {{{ nextDayOfWeek()
/**
* Returns date of the next specific day of the week
* from the given date
*
* @param int $dow the day of the week (0 = Sunday)
* @param int $day the day of the month, default is current local day
* @param int $month the month, default is current local month
* @param int $year the year in four digit format, default is current local year
* @param bool $onOrAfter if true and days are same, returns current day
* @param string $format the string indicating how to format the output
*
* @return string the date in the desired format
*
* @access public
* @static
*/
function nextDayOfWeek($dow, $day = 0, $month = 0, $year = 0,
$format = DATE_CALC_FORMAT, $onOrAfter = false)
{
if (empty($year)) {
$year = Date_Calc::dateNow('%Y');
}
if (empty($month)) {
$month = Date_Calc::dateNow('%m');
}
if (empty($day)) {
$day = Date_Calc::dateNow('%d');
}
$days = Date_Calc::dateToDays($day, $month, $year);
$curr_weekday = Date_Calc::dayOfWeek($day, $month, $year);
if ($curr_weekday == $dow) {
if (!$onOrAfter) {
$days += 7;
}
} elseif ($curr_weekday > $dow) {
$days += 7 - ($curr_weekday - $dow);
} else {
$days += $dow - $curr_weekday;
}
return Date_Calc::daysToDate($days, $format);
}
// }}}
// {{{ prevDayOfWeekOnOrBefore()
/**
* Returns date of the previous specific day of the week
* on or before the given date
*
* @param int $dow the day of the week (0 = Sunday)
* @param int $day the day of the month, default is current local day
* @param int $month the month, default is current local month
* @param int $year the year in four digit format, default is current local year
* @param string $format the string indicating how to format the output
*
* @return string the date in the desired format
*
* @access public
* @static
*/
function prevDayOfWeekOnOrBefore($dow, $day = 0, $month = 0, $year = 0,
$format = DATE_CALC_FORMAT)
{
return Date_Calc::prevDayOfWeek($dow, $day, $month, $year, $format,
true);
}
// }}}
// {{{ nextDayOfWeekOnOrAfter()
/**
* Returns date of the next specific day of the week
* on or after the given date
*
* @param int $dow the day of the week (0 = Sunday)
* @param int $day the day of the month, default is current local day
* @param int $month the month, default is current local month
* @param int $year the year in four digit format, default is current local year
* @param string $format the string indicating how to format the output
*
* @return string the date in the desired format
*
* @access public
* @static
*/
function nextDayOfWeekOnOrAfter($dow, $day = 0, $month = 0, $year = 0,
$format = DATE_CALC_FORMAT)
{
return Date_Calc::nextDayOfWeek($dow, $day, $month, $year, $format,
true);
}
// }}}
// {{{ beginOfWeek()
/**
* Find the month day of the beginning of week for given date,
* using DATE_CALC_BEGIN_WEEKDAY
*
* Can return weekday of prev month.
*
* @param int $day the day of the month, default is current local day
* @param int $month the month, default is current local month
* @param int $year the year in four digit format, default is current local year
* @param string $format the string indicating how to format the output
*
* @return string the date in the desired format
*
* @access public
* @static
*/
function beginOfWeek($day = 0, $month = 0, $year = 0,
$format = DATE_CALC_FORMAT)
{
if (empty($year)) {
$year = Date_Calc::dateNow('%Y');
}
if (empty($month)) {
$month = Date_Calc::dateNow('%m');
}
if (empty($day)) {
$day = Date_Calc::dateNow('%d');
}
$this_weekday = Date_Calc::dayOfWeek($day, $month, $year);
$interval = (7 - DATE_CALC_BEGIN_WEEKDAY + $this_weekday) % 7;
return Date_Calc::daysToDate(Date_Calc::dateToDays($day, $month, $year)
- $interval, $format);
}
// }}}
// {{{ endOfWeek()
/**
* Find the month day of the end of week for given date,
* using DATE_CALC_BEGIN_WEEKDAY
*
* Can return weekday of following month.
*
* @param int $day the day of the month, default is current local day
* @param int $month the month, default is current local month
* @param int $year the year in four digit format, default is current local year
* @param string $format the string indicating how to format the output
*
* @return string the date in the desired format
*
* @access public
* @static
*/
function endOfWeek($day = 0, $month = 0, $year = 0,
$format = DATE_CALC_FORMAT)
{
if (empty($year)) {
$year = Date_Calc::dateNow('%Y');
}
if (empty($month)) {
$month = Date_Calc::dateNow('%m');
}
if (empty($day)) {
$day = Date_Calc::dateNow('%d');
}
$this_weekday = Date_Calc::dayOfWeek($day, $month, $year);
$interval = (6 + DATE_CALC_BEGIN_WEEKDAY - $this_weekday) % 7;
return Date_Calc::daysToDate(Date_Calc::dateToDays($day, $month, $year)
+ $interval, $format);
}
// }}}
// {{{ beginOfPrevWeek()
/**
* Find the month day of the beginning of week before given date,
* using DATE_CALC_BEGIN_WEEKDAY
*
* Can return weekday of prev month.
*
* @param int $day the day of the month, default is current local day
* @param int $month the month, default is current local month
* @param int $year the year in four digit format, default is current local year
* @param string $format the string indicating how to format the output
*
* @return string the date in the desired format
*
* @access public
* @static
*/
function beginOfPrevWeek($day = 0, $month = 0, $year = 0,
$format = DATE_CALC_FORMAT)
{
if (empty($year)) {
$year = Date_Calc::dateNow('%Y');
}
if (empty($month)) {
$month = Date_Calc::dateNow('%m');
}
if (empty($day)) {
$day = Date_Calc::dateNow('%d');
}
$date = Date_Calc::daysToDate(Date_Calc::dateToDays($day-7,
$month,
$year),
'%Y%m%d');
$prev_week_year = substr($date, 0, 4);
$prev_week_month = substr($date, 4, 2);
$prev_week_day = substr($date, 6, 2);
return Date_Calc::beginOfWeek($prev_week_day, $prev_week_month,
$prev_week_year, $format);
}
// }}}
// {{{ beginOfNextWeek()
/**
* Find the month day of the beginning of week after given date,
* using DATE_CALC_BEGIN_WEEKDAY
*
* Can return weekday of prev month.
*
* @param int $day the day of the month, default is current local day
* @param int $month the month, default is current local month
* @param int $year the year in four digit format, default is current local year
* @param string $format the string indicating how to format the output
*
* @return string the date in the desired format
*
* @access public
* @static
*/
function beginOfNextWeek($day = 0, $month = 0, $year = 0,
$format = DATE_CALC_FORMAT)
{
if (empty($year)) {
$year = Date_Calc::dateNow('%Y');
}
if (empty($month)) {
$month = Date_Calc::dateNow('%m');
}
if (empty($day)) {
$day = Date_Calc::dateNow('%d');
}
$date = Date_Calc::daysToDate(Date_Calc::dateToDays($day + 7,
$month,
$year),
'%Y%m%d');
$next_week_year = substr($date, 0, 4);
$next_week_month = substr($date, 4, 2);
$next_week_day = substr($date, 6, 2);
return Date_Calc::beginOfWeek($next_week_day, $next_week_month,
$next_week_year, $format);
}
// }}}
// {{{ beginOfMonth()
/**
* Return date of first day of month of given date
*
* @param int $month the month, default is current local month
* @param int $year the year in four digit format, default is current local year
* @param string $format the string indicating how to format the output
*
* @return string the date in the desired format
*
* @access public
* @static
* @see Date_Calc::beginOfMonthBySpan()
* @deprecated Method deprecated in Release 1.4.4
*/
function beginOfMonth($month = 0, $year = 0, $format = DATE_CALC_FORMAT)
{
if (empty($year)) {
$year = Date_Calc::dateNow('%Y');
}
if (empty($month)) {
$month = Date_Calc::dateNow('%m');
}
return Date_Calc::dateFormat('01', $month, $year, $format);
}
// }}}
// {{{ beginOfPrevMonth()
/**
* Returns date of the first day of previous month of given date
*
* @param int $day the day of the month, default is current local day
* @param int $month the month, default is current local month
* @param int $year the year in four digit format, default is current local year
* @param string $format the string indicating how to format the output
*
* @return string the date in the desired format
*
* @access public
* @static
* @see Date_Calc::beginOfMonthBySpan()
* @deprecated Method deprecated in Release 1.4.4
*/
function beginOfPrevMonth($day = 0, $month = 0, $year = 0,
$format = DATE_CALC_FORMAT)
{
if (empty($year)) {
$year = Date_Calc::dateNow('%Y');
}
if (empty($month)) {
$month = Date_Calc::dateNow('%m');
}
if (empty($day)) {
$day = Date_Calc::dateNow('%d');
}
if ($month > 1) {
$month--;
$day = 1;
} else {
$year--;
$month = 12;
$day = 1;
}
return Date_Calc::dateFormat($day, $month, $year, $format);
}
// }}}
// {{{ endOfPrevMonth()
/**
* Returns date of the last day of previous month for given date
*
* @param int $day the day of the month, default is current local day
* @param int $month the month, default is current local month
* @param int $year the year in four digit format, default is current local year
* @param string $format the string indicating how to format the output
*
* @return string the date in the desired format
*
* @access public
* @static
* @see Date_Calc::endOfMonthBySpan()
* @deprecated Method deprecated in Release 1.4.4
*/
function endOfPrevMonth($day = 0, $month = 0, $year = 0,
$format = DATE_CALC_FORMAT)
{
if (empty($year)) {
$year = Date_Calc::dateNow('%Y');
}
if (empty($month)) {
$month = Date_Calc::dateNow('%m');
}
if (empty($day)) {
$day = Date_Calc::dateNow('%d');
}
if ($month > 1) {
$month--;
} else {
$year--;
$month = 12;
}
$day = Date_Calc::daysInMonth($month, $year);
return Date_Calc::dateFormat($day, $month, $year, $format);
}
// }}}
// {{{ beginOfNextMonth()
/**
* Returns date of begin of next month of given date
*
* @param int $day the day of the month, default is current local day
* @param int $month the month, default is current local month
* @param int $year the year in four digit format, default is current local year
* @param string $format the string indicating how to format the output
*
* @return string the date in the desired format
*
* @access public
* @static
* @see Date_Calc::beginOfMonthBySpan()
* @deprecated Method deprecated in Release 1.4.4
*/
function beginOfNextMonth($day = 0, $month = 0, $year = 0,
$format = DATE_CALC_FORMAT)
{
if (empty($year)) {
$year = Date_Calc::dateNow('%Y');
}
if (empty($month)) {
$month = Date_Calc::dateNow('%m');
}
if (empty($day)) {
$day = Date_Calc::dateNow('%d');
}
if ($month < 12) {
$month++;
$day = 1;
} else {
$year++;
$month = 1;
$day = 1;
}
return Date_Calc::dateFormat($day, $month, $year, $format);
}
// }}}
// {{{ endOfNextMonth()
/**
* Returns date of the last day of next month of given date
*
* @param int $day the day of the month, default is current local day
* @param int $month the month, default is current local month
* @param int $year the year in four digit format, default is current local year
* @param string $format the string indicating how to format the output
*
* @return string the date in the desired format
*
* @access public
* @static
* @see Date_Calc::endOfMonthBySpan()
* @deprecated Method deprecated in Release 1.4.4
*/
function endOfNextMonth($day = 0, $month = 0, $year = 0,
$format = DATE_CALC_FORMAT)
{
if (empty($year)) {
$year = Date_Calc::dateNow('%Y');
}
if (empty($month)) {
$month = Date_Calc::dateNow('%m');
}
if (empty($day)) {
$day = Date_Calc::dateNow('%d');
}
if ($month < 12) {
$month++;
} else {
$year++;
$month = 1;
}
$day = Date_Calc::daysInMonth($month, $year);
return Date_Calc::dateFormat($day, $month, $year, $format);
}
// }}}
// {{{ beginOfMonthBySpan()
/**
* Returns date of the first day of the month in the number of months
* from the given date
*
* @param int $months the number of months from the date provided.
* Positive numbers go into the future.
* Negative numbers go into the past.
* 0 is the month presented in $month.
* @param string $month the month, default is current local month
* @param string $year the year in four digit format, default is the
* current local year
* @param string $format the string indicating how to format the output
*
* @return string the date in the desired format
*
* @access public
* @static
* @since Method available since Release 1.4.4
*/
function beginOfMonthBySpan($months = 0, $month = 0, $year = 0,
$format = DATE_CALC_FORMAT)
{
if (empty($year)) {
$year = Date_Calc::dateNow('%Y');
}
if (empty($month)) {
$month = Date_Calc::dateNow('%m');
}
if ($months > 0) {
// future month
$tmp_mo = $month + $months;
$month = $tmp_mo % 12;
if ($month == 0) {
$month = 12;
$year = $year + floor(($tmp_mo - 1) / 12);
} else {
$year = $year + floor($tmp_mo / 12);
}
} else {
// past or present month
$tmp_mo = $month + $months;
if ($tmp_mo > 0) {
// same year
$month = $tmp_mo;
} elseif ($tmp_mo == 0) {
// prior dec
$month = 12;
$year--;
} else {
// some time in a prior year
$month = 12 + ($tmp_mo % 12);
$year = $year + floor($tmp_mo / 12);
}
}
return Date_Calc::dateFormat(1, $month, $year, $format);
}
// }}}
// {{{ endOfMonthBySpan()
/**
* Returns date of the last day of the month in the number of months
* from the given date
*
* @param int $months the number of months from the date provided.
* Positive numbers go into the future.
* Negative numbers go into the past.
* 0 is the month presented in $month.
* @param string $month the month, default is current local month
* @param string $year the year in four digit format, default is the
* current local year
* @param string $format the string indicating how to format the output
*
* @return string the date in the desired format
*
* @access public
* @static
* @since Method available since Release 1.4.4
*/
function endOfMonthBySpan($months = 0, $month = 0, $year = 0,
$format = DATE_CALC_FORMAT)
{
if (empty($year)) {
$year = Date_Calc::dateNow('%Y');
}
if (empty($month)) {
$month = Date_Calc::dateNow('%m');
}
if ($months > 0) {
// future month
$tmp_mo = $month + $months;
$month = $tmp_mo % 12;
if ($month == 0) {
$month = 12;
$year = $year + floor(($tmp_mo - 1) / 12);
} else {
$year = $year + floor($tmp_mo / 12);
}
} else {
// past or present month
$tmp_mo = $month + $months;
if ($tmp_mo > 0) {
// same year
$month = $tmp_mo;
} elseif ($tmp_mo == 0) {
// prior dec
$month = 12;
$year--;
} else {
// some time in a prior year
$month = 12 + ($tmp_mo % 12);
$year = $year + floor($tmp_mo / 12);
}
}
return Date_Calc::dateFormat(Date_Calc::daysInMonth($month, $year),
$month, $year, $format);
}
// }}}
// {{{ firstOfMonthWeekday()
/**
* Find the day of the week for the first of the month of given date
*
* @param int $month the month, default is current local month
* @param int $year the year in four digit format, default is current local year
*
* @return int number of weekday for the first day, 0=Sunday
*
* @access public
* @static
*/
function firstOfMonthWeekday($month = 0, $year = 0)
{
if (empty($year)) {
$year = Date_Calc::dateNow('%Y');
}
if (empty($month)) {
$month = Date_Calc::dateNow('%m');
}
return Date_Calc::dayOfWeek('01', $month, $year);
}
// }}}
// {{{ NWeekdayOfMonth()
/**
* Calculates the date of the Nth weekday of the month,
* such as the second Saturday of January 2000
*
* @param int $week the number of the week to get
* (1 = first, etc. Also can be 'last'.)
* @param int $dow the day of the week (0 = Sunday)
* @param int $month the month
* @param int $year the year. Use the complete year instead of the
* abbreviated version. E.g. use 2005, not 05.
* Do not add leading 0's for years prior to 1000.
* @param string $format the string indicating how to format the output
*
* @return string the date in the desired format
*
* @access public
* @static
*/
function NWeekdayOfMonth($week, $dow, $month, $year,
$format = DATE_CALC_FORMAT)
{
if (is_numeric($week)) {
$DOW1day = ($week - 1) * 7 + 1;
$DOW1 = Date_Calc::dayOfWeek($DOW1day, $month, $year);
$wdate = ($week - 1) * 7 + 1 + (7 + $dow - $DOW1) % 7;
if ($wdate > Date_Calc::daysInMonth($month, $year)) {
return -1;
} else {
return Date_Calc::dateFormat($wdate, $month, $year, $format);
}
} elseif ($week == 'last' && $dow < 7) {
$lastday = Date_Calc::daysInMonth($month, $year);
$lastdow = Date_Calc::dayOfWeek($lastday, $month, $year);
$diff = $dow - $lastdow;
if ($diff > 0) {
return Date_Calc::dateFormat($lastday - (7 - $diff), $month,
$year, $format);
} else {
return Date_Calc::dateFormat($lastday + $diff, $month,
$year, $format);
}
} else {
return -1;
}
}
// }}}
// {{{ isValidDate()
/**
* Returns true for valid date, false for invalid date
*
* @param int $day the day of the month
* @param int $month the month
* @param int $year the year. Use the complete year instead of the
* abbreviated version. E.g. use 2005, not 05.
* Do not add leading 0's for years prior to 1000.
*
* @return boolean
*
* @access public
* @static
*/
function isValidDate($day, $month, $year)
{
if ($year < 0 || $year > 9999) {
return false;
}
if (!checkdate($month, $day, $year)) {
return false;
}
return true;
}
// }}}
// {{{ isLeapYear()
/**
* Returns true for a leap year, else false
*
* @param int $year the year. Use the complete year instead of the
* abbreviated version. E.g. use 2005, not 05.
* Do not add leading 0's for years prior to 1000.
*
* @return boolean
*
* @access public
* @static
*/
function isLeapYear($year = 0)
{
if (empty($year)) {
$year = Date_Calc::dateNow('%Y');
}
if (preg_match('/\D/', $year)) {
return false;
}
if ($year < 1000) {
return false;
}
if ($year < 1582) {
// pre Gregorio XIII - 1582
return ($year % 4 == 0);
} else {
// post Gregorio XIII - 1582
return (($year % 4 == 0) && ($year % 100 != 0)) || ($year % 400 == 0);
}
}
// }}}
// {{{ isFutureDate()
/**
* Determines if given date is a future date from now
*
* @param int $day the day of the month
* @param int $month the month
* @param int $year the year. Use the complete year instead of the
* abbreviated version. E.g. use 2005, not 05.
* Do not add leading 0's for years prior to 1000.
*
* @return boolean
*
* @access public
* @static
*/
function isFutureDate($day, $month, $year)
{
$this_year = Date_Calc::dateNow('%Y');
$this_month = Date_Calc::dateNow('%m');
$this_day = Date_Calc::dateNow('%d');
if ($year > $this_year) {
return true;
} elseif ($year == $this_year) {
if ($month > $this_month) {
return true;
} elseif ($month == $this_month) {
if ($day > $this_day) {
return true;
}
}
}
return false;
}
// }}}
// {{{ isPastDate()
/**
* Determines if given date is a past date from now
*
* @param int $day the day of the month
* @param int $month the month
* @param int $year the year. Use the complete year instead of the
* abbreviated version. E.g. use 2005, not 05.
* Do not add leading 0's for years prior to 1000.
*
* @return boolean
*
* @access public
* @static
*/
function isPastDate($day, $month, $year)
{
$this_year = Date_Calc::dateNow('%Y');
$this_month = Date_Calc::dateNow('%m');
$this_day = Date_Calc::dateNow('%d');
if ($year < $this_year) {
return true;
} elseif ($year == $this_year) {
if ($month < $this_month) {
return true;
} elseif ($month == $this_month) {
if ($day < $this_day) {
return true;
}
}
}
return false;
}
// }}}
// {{{ dateDiff()
/**
* Returns number of days between two given dates
*
* @param int $day1 the day of the month
* @param int $month1 the month
* @param int $year1 the year. Use the complete year instead of the
* abbreviated version. E.g. use 2005, not 05.
* Do not add leading 0's for years prior to 1000.
* @param int $day2 the day of the month
* @param int $month2 the month
* @param int $year2 the year. Use the complete year instead of the
* abbreviated version. E.g. use 2005, not 05.
* Do not add leading 0's for years prior to 1000.
*
* @return int the absolute number of days between the two dates.
* If an error occurs, -1 is returned.
*
* @access public
* @static
*/
function dateDiff($day1, $month1, $year1, $day2, $month2, $year2)
{
if (!Date_Calc::isValidDate($day1, $month1, $year1)) {
return -1;
}
if (!Date_Calc::isValidDate($day2, $month2, $year2)) {
return -1;
}
return abs(Date_Calc::dateToDays($day1, $month1, $year1)
- Date_Calc::dateToDays($day2, $month2, $year2));
}
// }}}
// {{{ compareDates()
/**
* Compares two dates
*
* @param int $day1 the day of the month
* @param int $month1 the month
* @param int $year1 the year. Use the complete year instead of the
* abbreviated version. E.g. use 2005, not 05.
* Do not add leading 0's for years prior to 1000.
* @param int $day2 the day of the month
* @param int $month2 the month
* @param int $year2 the year. Use the complete year instead of the
* abbreviated version. E.g. use 2005, not 05.
* Do not add leading 0's for years prior to 1000.
*
* @return int 0 if the dates are equal. 1 if date 1 is later, -1 if
* date 1 is earlier.
*
* @access public
* @static
*/
function compareDates($day1, $month1, $year1, $day2, $month2, $year2)
{
$ndays1 = Date_Calc::dateToDays($day1, $month1, $year1);
$ndays2 = Date_Calc::dateToDays($day2, $month2, $year2);
if ($ndays1 == $ndays2) {
return 0;
}
return ($ndays1 > $ndays2) ? 1 : -1;
}
// }}}
}
// }}}
/*
* Local variables:
* mode: php
* tab-width: 4
* c-basic-offset: 4
* c-hanging-comment-ender-p: nil
* End:
*/
?> Date-1.4.7/Date/Human.php 100666 0 0 20551 10530726050 10113
* @copyright 1997-2006 Allan Kent
* @license http://www.opensource.org/licenses/bsd-license.php
* BSD License
* @version CVS: $Id: Human.php,v 1.6 2006/11/21 17:38:15 firman Exp $
* @link http://pear.php.net/package/Date
* @since File available since Release 1.3
*/
// }}}
// {{{ Class: Date_Human
/**
* Class to convert date strings between Gregorian and Human calendar formats
*
* The Human Calendar format has been proposed by Scott Flansburg and can be
* explained as follows:
* The year is made up of 13 months
* Each month has 28 days
* Counting of months starts from 0 (zero) so the months will run from 0 to 12
* New Years day (00) is a monthless day
* Note: Leap Years are not yet accounted for in the Human Calendar system
*
* @author Allan Kent
* @copyright 1997-2005 Allan Kent
* @license http://www.opensource.org/licenses/bsd-license.php
* BSD License
* @version Release: 1.4.7
* @link http://pear.php.net/package/Date
* @since Class available since Release 1.3
*/
class Date_Human
{
// {{{ gregorianToHuman()
/**
* Returns an associative array containing the converted date information
* in 'Human Calendar' format.
*
* @param int day in DD format, default current local day
* @param int month in MM format, default current local month
* @param int year in CCYY format, default to current local year
*
* @access public
*
* @return associative array(
* hdom, // Human Day Of Month, starting at 1
* hdow, // Human Day Of Week, starting at 1
* hwom, // Human Week of Month, starting at 1
* hwoy, // Human Week of Year, starting at 1
* hmoy, // Human Month of Year, starting at 0
* )
*
* If the day is New Years Day, the function will return
* "hdom" => 0
* "hdow" => 0
* "hwom" => 0
* "hwoy" => 0
* "hmoy" => -1
* Since 0 is a valid month number under the Human Calendar, I have left
* the month as -1 for New Years Day.
*/
function gregorianToHuman($day=0, $month=0, $year=0)
{
/*
* Check to see if any of the arguments are empty
* If they are then populate the $dateinfo array
* Then check to see which arguments are empty and fill
* those with the current date info
*/
if ((empty($day) || (empty($month)) || empty($year))) {
$dateinfo = getdate(time());
}
if (empty($day)) {
$day = $dateinfo["mday"];
}
if (empty($month)) {
$month = $dateinfo["mon"];
}
if (empty($year)) {
$year = $dateinfo["year"];
}
/*
* We need to know how many days into the year we are
*/
$dateinfo = getdate(mktime(0, 0, 0, $month, $day, $year));
$dayofyear = $dateinfo["yday"];
/*
* Human Calendar starts at 0 for months and the first day of the year
* is designated 00, so we need to start our day of the year at 0 for
* these calculations.
* Also, the day of the month is calculated with a modulus of 28.
* Because a day is 28 days, the last day of the month would have a
* remainder of 0 and not 28 as it should be. Decrementing $dayofyear
* gets around this.
*/
$dayofyear--;
/*
* 28 days in a month...
*/
$humanMonthOfYear = floor($dayofyear / 28);
/*
* If we are in the first month then the day of the month is $dayofyear
* else we need to find the modulus of 28.
*/
if ($humanMonthOfYear == 0) {
$humanDayOfMonth = $dayofyear;
} else {
$humanDayOfMonth = ($dayofyear) % 28;
}
/*
* Day of the week is modulus 7
*/
$humanDayOfWeek = $dayofyear % 7;
/*
* We can now increment $dayofyear back to it's correct value for
* the remainder of the calculations
*/
$dayofyear++;
/*
* $humanDayOfMonth needs to be incremented now - recall that we fudged
* it a bit by decrementing $dayofyear earlier
* Same goes for $humanDayOfWeek
*/
$humanDayOfMonth++;
$humanDayOfWeek++;
/*
* Week of the month is day of the month divided by 7, rounded up
* Same for week of the year, but use $dayofyear instead $humanDayOfMonth
*/
$humanWeekOfMonth = ceil($humanDayOfMonth / 7);
$humanWeekOfYear = ceil($dayofyear / 7);
/*
* Return an associative array of the values
*/
return array(
"hdom" => $humanDayOfMonth,
"hdow" => $humanDayOfWeek,
"hwom" => $humanWeekOfMonth,
"hwoy" => $humanWeekOfYear,
"hmoy" => $humanMonthOfYear );
}
// }}}
// {{{ humanToGregorian()
/**
* Returns unix timestamp for a given Human Calendar date
*
* @param int day in DD format
* @param int month in MM format
* @param int year in CCYY format, default to current local year
*
* @access public
*
* @return int unix timestamp of date
*/
function humanToGregorian($day, $month, $year=0)
{
/*
* Check to see if the year has been passed through.
* If not get current year
*/
if (empty($year)) {
$dateinfo = getdate(time());
$year = $dateinfo["year"];
}
/*
* We need to get the day of the year that we are currently at so that
* we can work out the Gregorian Month and day
*/
$DayOfYear = $month * 28;
$DayOfYear += $day;
/*
* Human Calendar starts at 0, so we need to increment $DayOfYear
* to take into account the day 00
*/
$DayOfYear++;
/*
* the mktime() function will correctly calculate the date for out of
* range values, so putting $DayOfYear instead of the day of the month
* will work fine.
*/
$GregorianTimeStamp = mktime(0, 0, 0, 1, $DayOfYear, $year);
return $GregorianTimeStamp;
}
// }}}
}
// }}}
/*
* Local variables:
* mode: php
* tab-width: 4
* c-basic-offset: 4
* c-hanging-comment-ender-p: nil
* End:
*/
?> Date-1.4.7/Date/Span.php 100666 0 0 102341 10530726050 7762
* @author Pierre-Alain Joye
* @copyright 1997-2006 Leandro Lucarella, Pierre-Alain Joye
* @license http://www.opensource.org/licenses/bsd-license.php
* BSD License
* @version CVS: $Id: Span.php,v 1.9 2006/11/21 17:38:15 firman Exp $
* @link http://pear.php.net/package/Date
* @since File available since Release 1.4
*/
// }}}
// {{{ Includes
/**
* Get the Date class
*/
require_once 'Date.php';
/**
* Get the Date_Calc class
*/
require_once 'Date/Calc.php';
// }}}
// {{{ Constants
/**
* Non Numeric Separated Values (NNSV) Input Format.
*
* Input format guessed from something like this:
* dayshoursminutesseconds
* Where is any quantity of non numeric chars. If no values are
* given, time span is set to zero, if one value is given, it's used for
* hours, if two values are given it's used for hours and minutes and if
* three values are given, it's used for hours, minutes and seconds.
* Examples:
* '' -> 0, 0, 0, 0 (days, hours, minutes, seconds)
* '12' -> 0, 12, 0, 0
* '12.30' -> 0, 12, 30, 0
* '12:30:18' -> 0, 12, 30, 18
* '3-12-30-18' -> 3, 12, 30, 18
* '3 days, 12-30-18' -> 3, 12, 30, 18
* '12:30 with 18 secs' -> 0, 12, 30, 18
*
* @const int
*/
define('DATE_SPAN_INPUT_FORMAT_NNSV', 1);
// }}}
// {{{ Global Variables
/**
* Default time format when converting to a string.
*
* @global string
*/
$GLOBALS['_DATE_SPAN_FORMAT'] = '%C';
/**
* Default time format when converting from a string.
*
* @global mixed
*/
$GLOBALS['_DATE_SPAN_INPUT_FORMAT'] = DATE_SPAN_INPUT_FORMAT_NNSV;
// }}}
// {{{ Class: Date_Span
/**
* Generic time span handling class for PEAR
*
* @author Leandro Lucarella
* @author Pierre-Alain Joye
* @copyright 1997-2006 Leandro Lucarella, Pierre-Alain Joye
* @license http://www.opensource.org/licenses/bsd-license.php
* BSD License
* @version Release: 1.4.7
* @link http://pear.php.net/package/Date
* @since Class available since Release 1.4
*/
class Date_Span
{
// {{{ Properties
/**
* @var int
*/
var $day;
/**
* @var int
*/
var $hour;
/**
* @var int
*/
var $minute;
/**
* @var int
*/
var $second;
// }}}
// {{{ Constructor
/**
* Constructor.
*
* Creates the time span object calling the set() method.
*
* @param mixed $time Time span expression.
* @param mixed $format Format string to set it from a string or the
* second date set it from a date diff.
*
* @see set()
* @access public
*/
function Date_Span($time = 0, $format = null)
{
$this->set($time, $format);
}
// }}}
// {{{ set()
/**
* Set the time span to a new value in a 'smart' way.
*
* Sets the time span depending on the argument types, calling
* to the appropriate setFromXxx() method.
*
* @param mixed $time Time span expression.
* @param mixed $format Format string to set it from a string or the
* second date set it from a date diff.
*
* @return bool true on success.
*
* @see setFromObject()
* @see setFromArray()
* @see setFromString()
* @see setFromSeconds()
* @see setFromDateDiff()
* @access public
*/
function set($time = 0, $format = null)
{
if (is_a($time, 'date_span')) {
return $this->copy($time);
} elseif (is_a($time, 'date') and is_a($format, 'date')) {
return $this->setFromDateDiff($time, $format);
} elseif (is_array($time)) {
return $this->setFromArray($time);
} elseif (is_string($time)) {
return $this->setFromString($time, $format);
} elseif (is_int($time)) {
return $this->setFromSeconds($time);
} else {
return $this->setFromSeconds(0);
}
}
// }}}
// {{{ setFromArray()
/**
* Set the time span from an array.
*
* Set the time span from an array. Any value can be a float (but it
* has no sense in seconds), for example array(23.5, 20, 0) is
* interpreted as 23 hours, .5*60 + 20 = 50 minutes and 0 seconds.
*
* @param array $time Items are counted from right to left. First
* item is for seconds, second for minutes, third
* for hours and fourth for days. If there are
* less items than 4, zero (0) is assumed for the
* absent values.
*
* @return bool True on success.
*
* @access public
*/
function setFromArray($time)
{
if (!is_array($time)) {
return false;
}
$tmp1 = new Date_Span;
if (!$tmp1->setFromSeconds(@array_pop($time))) {
return false;
}
$tmp2 = new Date_Span;
if (!$tmp2->setFromMinutes(@array_pop($time))) {
return false;
}
$tmp1->add($tmp2);
if (!$tmp2->setFromHours(@array_pop($time))) {
return false;
}
$tmp1->add($tmp2);
if (!$tmp2->setFromDays(@array_pop($time))) {
return false;
}
$tmp1->add($tmp2);
return $this->copy($tmp1);
}
// }}}
// {{{ setFromString()
/**
* Set the time span from a string based on an input format.
*
* Set the time span from a string based on an input format. This is
* some like a mix of format() method and sscanf() PHP function. The
* error checking and validation of this function is very primitive,
* so you should be carefull when using it with unknown $time strings.
* With this method you are assigning day, hour, minute and second
* values, and the last values are used. This means that if you use
* something like setFromString('10, 20', '%H, %h') your time span
* would be 20 hours long. Allways remember that this method set
* all the values, so if you had a $time span 30 minutes long
* and you make $time->setFromString('20 hours', '%H hours'), $time
* span would be 20 hours long (and not 20 hours and 30 minutes).
* Input format options:
* %C
Days with time, same as "%D, %H:%M:%S".
* %d
Total days as a float number
* (2 days, 12 hours = 2.5 days).
* %D
Days as a decimal number.
* %e
Total hours as a float number
* (1 day, 2 hours, 30 minutes = 26.5 hours).
* %f
Total minutes as a float number
* (2 minutes, 30 seconds = 2.5 minutes).
* %g
Total seconds as a decimal number
* (2 minutes, 30 seconds = 90 seconds).
* %h
Hours as decimal number.
* %H
Hours as decimal number limited to 2 digits.
* %m
Minutes as a decimal number.
* %M
Minutes as a decimal number limited to 2 digits.
* %n
Newline character (\n).
* %p
Either 'am' or 'pm' depending on the time. If 'pm'
* is detected it adds 12 hours to the resulting time
* span (without any checks). This is case
* insensitive.
* %r
Time in am/pm notation, same as "%H:%M:%S %p".
* %R
Time in 24-hour notation, same as "%H:%M".
* %s
Seconds as a decimal number.
* %S
Seconds as a decimal number limited to 2 digits.
* %t
Tab character (\t).
* %T
Current time equivalent, same as "%H:%M:%S".
* %%
Literal '%'.
*
* @param string $time String from where to get the time span
* information.
* @param string $format Format string.
*
* @return bool True on success.
*
* @access public
*/
function setFromString($time, $format = null)
{
if (is_null($format)) {
$format = $GLOBALS['_DATE_SPAN_INPUT_FORMAT'];
}
// If format is a string, it parses the string format.
if (is_string($format)) {
$str = '';
$vars = array();
$pm = 'am';
$day = $hour = $minute = $second = 0;
for ($i = 0; $i < strlen($format); $i++) {
$char = $format{$i};
if ($char == '%') {
$nextchar = $format{++$i};
switch ($nextchar) {
case 'c':
$str .= '%d, %d:%d:%d';
array_push(
$vars, 'day', 'hour', 'minute', 'second');
break;
case 'C':
$str .= '%d, %2d:%2d:%2d';
array_push(
$vars, 'day', 'hour', 'minute', 'second');
break;
case 'd':
$str .= '%f';
array_push($vars, 'day');
break;
case 'D':
$str .= '%d';
array_push($vars, 'day');
break;
case 'e':
$str .= '%f';
array_push($vars, 'hour');
break;
case 'f':
$str .= '%f';
array_push($vars, 'minute');
break;
case 'g':
$str .= '%f';
array_push($vars, 'second');
break;
case 'h':
$str .= '%d';
array_push($vars, 'hour');
break;
case 'H':
$str .= '%2d';
array_push($vars, 'hour');
break;
case 'm':
$str .= '%d';
array_push($vars, 'minute');
break;
case 'M':
$str .= '%2d';
array_push($vars, 'minute');
break;
case 'n':
$str .= "\n";
break;
case 'p':
$str .= '%2s';
array_push($vars, 'pm');
break;
case 'r':
$str .= '%2d:%2d:%2d %2s';
array_push(
$vars, 'hour', 'minute', 'second', 'pm');
break;
case 'R':
$str .= '%2d:%2d';
array_push($vars, 'hour', 'minute');
break;
case 's':
$str .= '%d';
array_push($vars, 'second');
break;
case 'S':
$str .= '%2d';
array_push($vars, 'second');
break;
case 't':
$str .= "\t";
break;
case 'T':
$str .= '%2d:%2d:%2d';
array_push($vars, 'hour', 'minute', 'second');
break;
case '%':
$str .= "%";
break;
default:
$str .= $char . $nextchar;
}
} else {
$str .= $char;
}
}
$vals = sscanf($time, $str);
foreach ($vals as $i => $val) {
if (is_null($val)) {
return false;
}
$$vars[$i] = $val;
}
if (strcasecmp($pm, 'pm') == 0) {
$hour += 12;
} elseif (strcasecmp($pm, 'am') != 0) {
return false;
}
$this->setFromArray(array($day, $hour, $minute, $second));
// If format is a integer, it uses a predefined format
// detection method.
} elseif (is_integer($format)) {
switch ($format) {
case DATE_SPAN_INPUT_FORMAT_NNSV:
$time = preg_split('/\D+/', $time);
switch (count($time)) {
case 0:
return $this->setFromArray(
array(0, 0, 0, 0));
case 1:
return $this->setFromArray(
array(0, $time[0], 0, 0));
case 2:
return $this->setFromArray(
array(0, $time[0], $time[1], 0));
case 3:
return $this->setFromArray(
array(0, $time[0], $time[1], $time[2]));
default:
return $this->setFromArray($time);
}
break;
}
}
return false;
}
// }}}
// {{{ setFromSeconds()
/**
* Set the time span from a total number of seconds.
*
* @param int $seconds Total number of seconds.
*
* @return bool True on success.
*
* @access public
*/
function setFromSeconds($seconds)
{
if ($seconds < 0) {
return false;
}
$sec = intval($seconds);
$min = floor($sec / 60);
$hour = floor($min / 60);
$day = intval(floor($hour / 24));
$this->second = $sec % 60;
$this->minute = $min % 60;
$this->hour = $hour % 24;
$this->day = $day;
return true;
}
// }}}
// {{{ setFromMinutes()
/**
* Set the time span from a total number of minutes.
*
* @param float $minutes Total number of minutes.
*
* @return bool True on success.
*
* @access public
*/
function setFromMinutes($minutes)
{
return $this->setFromSeconds(round($minutes * 60));
}
// }}}
// {{{ setFromHours()
/**
* Set the time span from a total number of hours.
*
* @param float $hours Total number of hours.
*
* @return bool True on success.
*
* @access public
*/
function setFromHours($hours)
{
return $this->setFromSeconds(round($hours * 3600));
}
// }}}
// {{{ setFromDays()
/**
* Set the time span from a total number of days.
*
* @param float $days Total number of days.
*
* @return bool True on success.
*
* @access public
*/
function setFromDays($days)
{
return $this->setFromSeconds(round($days * 86400));
}
// }}}
// {{{ setFromDateDiff()
/**
* Set the span from the elapsed time between two dates.
*
* Set the span from the elapsed time between two dates. The time span
* is allways positive, so the date's order is not important.
*
* @param object Date $date1 First Date.
* @param object Date $date2 Second Date.
*
* @return bool True on success.
*
* @access public
*/
function setFromDateDiff($date1, $date2)
{
if (!is_a($date1, 'date') or !is_a($date2, 'date')) {
return false;
}
$date1->toUTC();
$date2->toUTC();
if ($date1->after($date2)) {
list($date1, $date2) = array($date2, $date1);
}
$days = Date_Calc::dateDiff(
$date1->getDay(), $date1->getMonth(), $date1->getYear(),
$date2->getDay(), $date2->getMonth(), $date2->getYear()
);
$hours = $date2->getHour() - $date1->getHour();
$mins = $date2->getMinute() - $date1->getMinute();
$secs = $date2->getSecond() - $date1->getSecond();
$this->setFromSeconds(
$days * 86400 + $hours * 3600 + $mins * 60 + $secs
);
return true;
}
// }}}
// {{{ copy()
/**
* Set the time span from another time object.
*
* @param object Date_Span $time Source time span object.
*
* @return bool True on success.
*
* @access public
*/
function copy($time)
{
if (is_a($time, 'date_span')) {
$this->second = $time->second;
$this->minute = $time->minute;
$this->hour = $time->hour;
$this->day = $time->day;
return true;
} else {
return false;
}
}
// }}}
// {{{ format()
/**
* Time span pretty printing (similar to Date::format()).
*
* Formats the time span in the given format, similar to
* strftime() and Date::format().
*
* Formatting options:
* %C
Days with time, same as "%D, %H:%M:%S".
* %d
Total days as a float number
* (2 days, 12 hours = 2.5 days).
* %D
Days as a decimal number.
* %e
Total hours as a float number
* (1 day, 2 hours, 30 minutes = 26.5 hours).
* %E
Total hours as a decimal number
* (1 day, 2 hours, 40 minutes = 26 hours).
* %f
Total minutes as a float number
* (2 minutes, 30 seconds = 2.5 minutes).
* %F
Total minutes as a decimal number
* (1 hour, 2 minutes, 40 seconds = 62 minutes).
* %g
Total seconds as a decimal number
* (2 minutes, 30 seconds = 90 seconds).
* %h
Hours as decimal number (0 to 23).
* %H
Hours as decimal number (00 to 23).
* %i
Hours as decimal number on 12-hour clock
* (1 to 12).
* %I
Hours as decimal number on 12-hour clock
* (01 to 12).
* %m
Minutes as a decimal number (0 to 59).
* %M
Minutes as a decimal number (00 to 59).
* %n
Newline character (\n).
* %p
Either 'am' or 'pm' depending on the time.
* %P
Either 'AM' or 'PM' depending on the time.
* %r
Time in am/pm notation, same as "%I:%M:%S %p".
* %R
Time in 24-hour notation, same as "%H:%M".
* %s
Seconds as a decimal number (0 to 59).
* %S
Seconds as a decimal number (00 to 59).
* %t
Tab character (\t).
* %T
Current time equivalent, same as "%H:%M:%S".
* %%
Literal '%'.
*
* @param string $format The format string for returned time span.
*
* @return string The time span in specified format.
*
* @access public
*/
function format($format = null)
{
if (is_null($format)) {
$format = $GLOBALS['_DATE_SPAN_FORMAT'];
}
$output = '';
for ($i = 0; $i < strlen($format); $i++) {
$char = $format{$i};
if ($char == '%') {
$nextchar = $format{++$i};
switch ($nextchar) {
case 'C':
$output .= sprintf(
'%d, %02d:%02d:%02d',
$this->day,
$this->hour,
$this->minute,
$this->second
);
break;
case 'd':
$output .= $this->toDays();
break;
case 'D':
$output .= $this->day;
break;
case 'e':
$output .= $this->toHours();
break;
case 'E':
$output .= floor($this->toHours());
break;
case 'f':
$output .= $this->toMinutes();
break;
case 'F':
$output .= floor($this->toMinutes());
break;
case 'g':
$output .= $this->toSeconds();
break;
case 'h':
$output .= $this->hour;
break;
case 'H':
$output .= sprintf('%02d', $this->hour);
break;
case 'i':
$hour =
($this->hour + 1) > 12 ?
$this->hour - 12 :
$this->hour;
$output .= ($hour == 0) ? 12 : $hour;
break;
case 'I':
$hour =
($this->hour + 1) > 12 ?
$this->hour - 12 :
$this->hour;
$output .= sprintf('%02d', $hour==0 ? 12 : $hour);
break;
case 'm':
$output .= $this->minute;
break;
case 'M':
$output .= sprintf('%02d',$this->minute);
break;
case 'n':
$output .= "\n";
break;
case 'p':
$output .= $this->hour >= 12 ? 'pm' : 'am';
break;
case 'P':
$output .= $this->hour >= 12 ? 'PM' : 'AM';
break;
case 'r':
$hour =
($this->hour + 1) > 12 ?
$this->hour - 12 :
$this->hour;
$output .= sprintf(
'%02d:%02d:%02d %s',
$hour==0 ? 12 : $hour,
$this->minute,
$this->second,
$this->hour >= 12 ? 'pm' : 'am'
);
break;
case 'R':
$output .= sprintf(
'%02d:%02d', $this->hour, $this->minute
);
break;
case 's':
$output .= $this->second;
break;
case 'S':
$output .= sprintf('%02d', $this->second);
break;
case 't':
$output .= "\t";
break;
case 'T':
$output .= sprintf(
'%02d:%02d:%02d',
$this->hour, $this->minute, $this->second
);
break;
case '%':
$output .= "%";
break;
default:
$output .= $char . $nextchar;
}
} else {
$output .= $char;
}
}
return $output;
}
// }}}
// {{{ toSeconds()
/**
* Convert time span to seconds.
*
* @return int Time span as an integer number of seconds.
*
* @access public
*/
function toSeconds()
{
return $this->day * 86400 + $this->hour * 3600 +
$this->minute * 60 + $this->second;
}
// }}}
// {{{ toMinutes()
/**
* Convert time span to minutes.
*
* @return float Time span as a decimal number of minutes.
*
* @access public
*/
function toMinutes()
{
return $this->day * 1440 + $this->hour * 60 + $this->minute +
$this->second / 60;
}
// }}}
// {{{ toHours()
/**
* Convert time span to hours.
*
* @return float Time span as a decimal number of hours.
*
* @access public
*/
function toHours()
{
return $this->day * 24 + $this->hour + $this->minute / 60 +
$this->second / 3600;
}
// }}}
// {{{ toDays()
/**
* Convert time span to days.
*
* @return float Time span as a decimal number of days.
*
* @access public
*/
function toDays()
{
return $this->day + $this->hour / 24 + $this->minute / 1440 +
$this->second / 86400;
}
// }}}
// {{{ add()
/**
* Adds a time span.
*
* @param object Date_Span $time Time span to add.
*
* @access public
*/
function add($time)
{
return $this->setFromSeconds(
$this->toSeconds() + $time->toSeconds()
);
}
// }}}
// {{{ substract()
/**
* Subtracts a time span.
*
* Subtracts a time span. If the time span to subtract is larger
* than the original, the result is zero (there's no sense in
* negative time spans).
*
* @param object Date_Span $time Time span to subtract.
*
* @access public
*/
function subtract($time)
{
$sub = $this->toSeconds() - $time->toSeconds();
if ($sub < 0) {
$this->setFromSeconds(0);
} else {
$this->setFromSeconds($sub);
}
}
// }}}
// {{{ equal()
/**
* Tells if time span is equal to $time.
*
* @param object Date_Span $time Time span to compare to.
*
* @return bool True if the time spans are equal.
*
* @access public
*/
function equal($time)
{
return $this->toSeconds() == $time->toSeconds();
}
// }}}
// {{{ greaterEqual()
/**
* Tells if this time span is greater or equal than $time.
*
* @param object Date_Span $time Time span to compare to.
*
* @return bool True if this time span is greater or equal than $time.
*
* @access public
*/
function greaterEqual($time)
{
return $this->toSeconds() >= $time->toSeconds();
}
// }}}
// {{{ lowerEqual()
/**
* Tells if this time span is lower or equal than $time.
*
* @param object Date_Span $time Time span to compare to.
*
* @return bool True if this time span is lower or equal than $time.
*
* @access public
*/
function lowerEqual($time)
{
return $this->toSeconds() <= $time->toSeconds();
}
// }}}
// {{{ greater()
/**
* Tells if this time span is greater than $time.
*
* @param object Date_Span $time Time span to compare to.
*
* @return bool True if this time span is greater than $time.
*
* @access public
*/
function greater($time)
{
return $this->toSeconds() > $time->toSeconds();
}
// }}}
// {{{ lower()
/**
* Tells if this time span is lower than $time.
*
* @param object Date_Span $time Time span to compare to.
*
* @return bool True if this time span is lower than $time.
*
* @access public
*/
function lower($time)
{
return $this->toSeconds() < $time->toSeconds();
}
// }}}
// {{{ compare()
/**
* Compares two time spans.
*
* Compares two time spans. Suitable for use in sorting functions.
*
* @param object Date_Span $time1 The first time span.
* @param object Date_Span $time2 The second time span.
*
* @return int 0 if the time spans are equal, -1 if time1 is lower
* than time2, 1 if time1 is greater than time2.
*
* @static
* @access public
*/
function compare($time1, $time2)
{
if ($time1->equal($time2)) {
return 0;
} elseif ($time1->lower($time2)) {
return -1;
} else {
return 1;
}
}
// }}}
// {{{ isEmpty()
/**
* Tells if the time span is empty (zero length).
*
* @return bool True is it's empty.
*/
function isEmpty()
{
return !$this->day && !$this->hour && !$this->minute && !$this->second;
}
// }}}
// {{{ setDefaultInputFormat()
/**
* Set the default input format.
*
* @param mixed $format New default input format.
*
* @return mixed Previous default input format.
*
* @static
*/
function setDefaultInputFormat($format)
{
$old = $GLOBALS['_DATE_SPAN_INPUT_FORMAT'];
$GLOBALS['_DATE_SPAN_INPUT_FORMAT'] = $format;
return $old;
}
// }}}
// {{{ getDefaultInputFormat()
/**
* Get the default input format.
*
* @return mixed Default input format.
*
* @static
*/
function getDefaultInputFormat()
{
return $GLOBALS['_DATE_SPAN_INPUT_FORMAT'];
}
// }}}
// {{{ setDefaultFormat()
/**
* Set the default format.
*
* @param mixed $format New default format.
*
* @return mixed Previous default format.
*
* @static
*/
function setDefaultFormat($format)
{
$old = $GLOBALS['_DATE_SPAN_FORMAT'];
$GLOBALS['_DATE_SPAN_FORMAT'] = $format;
return $old;
}
// }}}
// {{{ getDefaultFormat()
/**
* Get the default format.
*
* @return mixed Default format.
*
* @static
*/
function getDefaultFormat()
{
return $GLOBALS['_DATE_SPAN_FORMAT'];
}
// }}}
// {{{ __clone()
/**
* Returns a copy of the object (workarround for PHP5 forward compatibility).
*
* @return object Date_Span Copy of the object.
*/
function __clone() {
$c = get_class($this);
$s = new $c;
$s->day = $this->day;
$s->hour = $this->hour;
$s->minute = $this->minute;
$s->second = $this->second;
return $s;
}
// }}}
}
// }}}
/*
* Local variables:
* mode: php
* tab-width: 4
* c-basic-offset: 4
* c-hanging-comment-ender-p: nil
* End:
*/
?> Date-1.4.7/Date/TimeZone.php 100666 0 0 476453 10530726050 10635
* @author Pierre-Alain Joye
* @copyright 1997-2006 Baba Buehler, Pierre-Alain Joye
* @license http://www.opensource.org/licenses/bsd-license.php
* BSD License
* @version CVS: $Id: TimeZone.php,v 1.14 2006/11/22 01:03:12 firman Exp $
* @link http://pear.php.net/package/Date
*/
// }}}
// {{{ Class: Date_TimeZone
/**
* TimeZone representation class, along with time zone information data
*
* The default timezone is set from the first valid timezone id found
* in one of the following places, in this order:
* + global $_DATE_TIMEZONE_DEFAULT
* + system environment variable PHP_TZ
* + system environment variable TZ
* + the result of date('T')
*
* If no valid timezone id is found, the default timezone is set to 'UTC'.
* You may also manually set the default timezone by passing a valid id to
* Date_TimeZone::setDefault().
*
* This class includes time zone data (from zoneinfo) in the form of a
* global array, $_DATE_TIMEZONE_DATA.
*
* @author Baba Buehler
* @copyright 1997-2006 Baba Buehler, Pierre-Alain Joye
* @license http://www.opensource.org/licenses/bsd-license.php
* BSD License
* @version Release: 1.4.7
* @link http://pear.php.net/package/Date
*/
class Date_TimeZone
{
// {{{ Properties
/**
* Time Zone ID of this time zone
* @var string
*/
var $id;
/**
* Long Name of this time zone (ie Central Standard Time)
* @var string
*/
var $longname;
/**
* Short Name of this time zone (ie CST)
* @var string
*/
var $shortname;
/**
* true if this time zone observes daylight savings time
* @var boolean
*/
var $hasdst;
/**
* DST Long Name of this time zone
* @var string
*/
var $dstlongname;
/**
* DST Short Name of this timezone
* @var string
*/
var $dstshortname;
/**
* offset, in milliseconds, of this timezone
* @var int
*/
var $offset;
/**
* System Default Time Zone
* @var object Date_TimeZone
*/
var $default;
// }}}
// {{{ Constructor
/**
* Constructor
*
* Creates a new Date::TimeZone object, representing the time zone
* specified in $id. If the supplied ID is invalid, the created
* time zone is UTC.
*
* @access public
* @param string $id the time zone id
* @return object Date_TimeZone the new Date_TimeZone object
*/
function Date_TimeZone($id)
{
$_DATE_TIMEZONE_DATA =& $GLOBALS['_DATE_TIMEZONE_DATA'];
if(Date_TimeZone::isValidID($id)) {
$this->id = $id;
$this->longname = $_DATE_TIMEZONE_DATA[$id]['longname'];
$this->shortname = $_DATE_TIMEZONE_DATA[$id]['shortname'];
$this->offset = $_DATE_TIMEZONE_DATA[$id]['offset'];
if($_DATE_TIMEZONE_DATA[$id]['hasdst']) {
$this->hasdst = true;
$this->dstlongname = $_DATE_TIMEZONE_DATA[$id]['dstlongname'];
$this->dstshortname = $_DATE_TIMEZONE_DATA[$id]['dstshortname'];
} else {
$this->hasdst = false;
$this->dstlongname = $this->longname;
$this->dstshortname = $this->shortname;
}
} else {
$this->id = 'UTC';
$this->longname = $_DATE_TIMEZONE_DATA[$this->id]['longname'];
$this->shortname = $_DATE_TIMEZONE_DATA[$this->id]['shortname'];
$this->hasdst = $_DATE_TIMEZONE_DATA[$this->id]['hasdst'];
$this->offset = $_DATE_TIMEZONE_DATA[$this->id]['offset'];
}
}
// }}}
// {{{ getDefault()
/**
* Return a TimeZone object representing the system default time zone
*
* Return a TimeZone object representing the system default time zone,
* which is initialized during the loading of TimeZone.php.
*
* @access public
* @return object Date_TimeZone the default time zone
*/
function getDefault()
{
return new Date_TimeZone($GLOBALS['_DATE_TIMEZONE_DEFAULT']);
}
// }}}
// {{{ setDefault()
/**
* Sets the system default time zone to the time zone in $id
*
* Sets the system default time zone to the time zone in $id
*
* @access public
* @param string $id the time zone id to use
*/
function setDefault($id)
{
if(Date_TimeZone::isValidID($id)) {
$GLOBALS['_DATE_TIMEZONE_DEFAULT'] = $id;
}
}
// }}}
// {{{ isValidID()
/**
* Tests if given id is represented in the $_DATE_TIMEZONE_DATA time zone data
*
* Tests if given id is represented in the $_DATE_TIMEZONE_DATA time zone data
*
* @access public
* @param string $id the id to test
* @return boolean true if the supplied ID is valid
*/
function isValidID($id)
{
if(isset($GLOBALS['_DATE_TIMEZONE_DATA'][$id])) {
return true;
} else {
return false;
}
}
// }}}
// {{{ isEqual()
/**
* Is this time zone equal to another
*
* Tests to see if this time zone is equal (ids match)
* to a given Date_TimeZone object.
*
* @access public
* @param object Date_TimeZone $tz the timezone to test
* @return boolean true if this time zone is equal to the supplied time zone
*/
function isEqual($tz)
{
if(strcasecmp($this->id, $tz->id) == 0) {
return true;
} else {
return false;
}
}
// }}}
// {{{ isEquivalent()
/**
* Is this time zone equivalent to another
*
* Tests to see if this time zone is equivalent to
* a given time zone object. Equivalence in this context
* is defined by the two time zones having an equal raw
* offset and an equal setting of "hasdst". This is not true
* equivalence, as the two time zones may have different rules
* for the observance of DST, but this implementation does not
* know DST rules.
*
* @access public
* @param object Date_TimeZone $tz the timezone object to test
* @return boolean true if this time zone is equivalent to the supplied time zone
*/
function isEquivalent($tz)
{
if($this->offset == $tz->offset && $this->hasdst == $tz->hasdst) {
return true;
} else {
return false;
}
}
// }}}
// {{{ hasDaylightTime()
/**
* Returns true if this zone observes daylight savings time
*
* Returns true if this zone observes daylight savings time
*
* @access public
* @return boolean true if this time zone has DST
*/
function hasDaylightTime()
{
return $this->hasdst;
}
// }}}
// {{{ inDaylightTime()
/**
* Is the given date/time in DST for this time zone
*
* Attempts to determine if a given Date object represents a date/time
* that is in DST for this time zone. WARNINGS: this basically attempts to
* "trick" the system into telling us if we're in DST for a given time zone.
* This uses putenv() which may not work in safe mode, and relies on unix time
* which is only valid for dates from 1970 to ~2038. This relies on the
* underlying OS calls, so it may not work on Windows or on a system where
* zoneinfo is not installed or configured properly.
*
* @access public
* @param object Date $date the date/time to test
* @return boolean true if this date is in DST for this time zone
*/
function inDaylightTime($date)
{
$env_tz = '';
if(isset($_ENV['TZ']) && getenv('TZ')) {
$env_tz = getenv('TZ');
}
putenv('TZ=' . $this->id);
$ltime = localtime($date->getTime(), true);
if ($env_tz != '') {
putenv('TZ=' . $env_tz);
}
return $ltime['tm_isdst'];
}
// }}}
// {{{ getDSTSavings()
/**
* Get the DST offset for this time zone
*
* Returns the DST offset of this time zone, in milliseconds,
* if the zone observes DST, zero otherwise. Currently the
* DST offset is hard-coded to one hour.
*
* @access public
* @return int the DST offset, in milliseconds or zero if the zone does not observe DST
*/
function getDSTSavings()
{
if($this->hasdst) {
return 3600000;
} else {
return 0;
}
}
// }}}
// {{{ getOffset()
/**
* Get the DST-corrected offset to UTC for the given date
*
* Attempts to get the offset to UTC for a given date/time, taking into
* account daylight savings time, if the time zone observes it and if
* it is in effect. Please see the WARNINGS on Date::TimeZone::inDaylightTime().
*
*
* @access public
* @param object Date $date the Date to test
* @return int the corrected offset to UTC in milliseconds
*/
function getOffset($date)
{
if($this->inDaylightTime($date)) {
return $this->offset + $this->getDSTSavings();
} else {
return $this->offset;
}
}
// }}}
// {{{ getAvailableIDs()
/**
* Returns the list of valid time zone id strings
*
* Returns the list of valid time zone id strings
*
* @access public
* @return mixed an array of strings with the valid time zone IDs
*/
function getAvailableIDs()
{
return array_keys($GLOBALS['_DATE_TIMEZONE_DATA']);
}
// }}}
// {{{ getID()
/**
* Returns the id for this time zone
*
* Returns the time zone id for this time zone, i.e. "America/Chicago"
*
* @access public
* @return string the id
*/
function getID()
{
return $this->id;
}
// }}}
// {{{ getLongName()
/**
* Returns the long name for this time zone
*
* Returns the long name for this time zone,
* i.e. "Central Standard Time"
*
* @access public
* @return string the long name
*/
function getLongName()
{
return $this->longname;
}
// }}}
// {{{ getShortName()
/**
* Returns the short name for this time zone
*
* Returns the short name for this time zone, i.e. "CST"
*
* @access public
* @return string the short name
*/
function getShortName()
{
return $this->shortname;
}
// }}}
// {{{ getDSTLongName()
/**
* Returns the DST long name for this time zone
*
* Returns the DST long name for this time zone, i.e. "Central Daylight Time"
*
* @access public
* @return string the daylight savings time long name
*/
function getDSTLongName()
{
return $this->dstlongname;
}
// }}}
// {{{ getDSTShortName()
/**
* Returns the DST short name for this time zone
*
* Returns the DST short name for this time zone, i.e. "CDT"
*
* @access public
* @return string the daylight savings time short name
*/
function getDSTShortName()
{
return $this->dstshortname;
}
// }}}
// {{{ getRawOffset()
/**
* Returns the raw (non-DST-corrected) offset from UTC/GMT for this time zone
*
* Returns the raw (non-DST-corrected) offset from UTC/GMT for this time zone
*
* @access public
* @return int the offset, in milliseconds
*/
function getRawOffset()
{
return $this->offset;
}
// }}}
}
// }}}
/**
* Time Zone Data offset is in miliseconds
*
* @global array $GLOBALS['_DATE_TIMEZONE_DATA']
*/
$GLOBALS['_DATE_TIMEZONE_DATA'] = array(
'Etc/GMT+12' => array(
'offset' => -43200000,
'longname' => 'GMT-12:00',
'shortname' => 'GMT-12:00',
'hasdst' => false ),
'Etc/GMT+11' => array(
'offset' => -39600000,
'longname' => 'GMT-11:00',
'shortname' => 'GMT-11:00',
'hasdst' => false ),
'MIT' => array(
'offset' => -39600000,
'longname' => 'West Samoa Time',
'shortname' => 'WST',
'hasdst' => false ),
'Pacific/Apia' => array(
'offset' => -39600000,
'longname' => 'West Samoa Time',
'shortname' => 'WST',
'hasdst' => false ),
'Pacific/Midway' => array(
'offset' => -39600000,
'longname' => 'Samoa Standard Time',
'shortname' => 'SST',
'hasdst' => false ),
'Pacific/Niue' => array(
'offset' => -39600000,
'longname' => 'Niue Time',
'shortname' => 'NUT',
'hasdst' => false ),
'Pacific/Pago_Pago' => array(
'offset' => -39600000,
'longname' => 'Samoa Standard Time',
'shortname' => 'SST',
'hasdst' => false ),
'Pacific/Samoa' => array(
'offset' => -39600000,
'longname' => 'Samoa Standard Time',
'shortname' => 'SST',
'hasdst' => false ),
'US/Samoa' => array(
'offset' => -39600000,
'longname' => 'Samoa Standard Time',
'shortname' => 'SST',
'hasdst' => false ),
'America/Adak' => array(
'offset' => -36000000,
'longname' => 'Hawaii-Aleutian Standard Time',
'shortname' => 'HAST',
'hasdst' => true,
'dstlongname' => 'Hawaii-Aleutian Daylight Time',
'dstshortname' => 'HADT' ),
'America/Atka' => array(
'offset' => -36000000,
'longname' => 'Hawaii-Aleutian Standard Time',
'shortname' => 'HAST',
'hasdst' => true,
'dstlongname' => 'Hawaii-Aleutian Daylight Time',
'dstshortname' => 'HADT' ),
'Etc/GMT+10' => array(
'offset' => -36000000,
'longname' => 'GMT-10:00',
'shortname' => 'GMT-10:00',
'hasdst' => false ),
'HST' => array(
'offset' => -36000000,
'longname' => 'Hawaii Standard Time',
'shortname' => 'HST',
'hasdst' => false ),
'Pacific/Fakaofo' => array(
'offset' => -36000000,
'longname' => 'Tokelau Time',
'shortname' => 'TKT',
'hasdst' => false ),
'Pacific/Honolulu' => array(
'offset' => -36000000,
'longname' => 'Hawaii Standard Time',
'shortname' => 'HST',
'hasdst' => false ),
'Pacific/Johnston' => array(
'offset' => -36000000,
'longname' => 'Hawaii Standard Time',
'shortname' => 'HST',
'hasdst' => false ),
'Pacific/Rarotonga' => array(
'offset' => -36000000,
'longname' => 'Cook Is. Time',
'shortname' => 'CKT',
'hasdst' => false ),
'Pacific/Tahiti' => array(
'offset' => -36000000,
'longname' => 'Tahiti Time',
'shortname' => 'TAHT',
'hasdst' => false ),
'SystemV/HST10' => array(
'offset' => -36000000,
'longname' => 'Hawaii Standard Time',
'shortname' => 'HST',
'hasdst' => false ),
'US/Aleutian' => array(
'offset' => -36000000,
'longname' => 'Hawaii-Aleutian Standard Time',
'shortname' => 'HAST',
'hasdst' => true,
'dstlongname' => 'Hawaii-Aleutian Daylight Time',
'dstshortname' => 'HADT' ),
'US/Hawaii' => array(
'offset' => -36000000,
'longname' => 'Hawaii Standard Time',
'shortname' => 'HST',
'hasdst' => false ),
'Pacific/Marquesas' => array(
'offset' => -34200000,
'longname' => 'Marquesas Time',
'shortname' => 'MART',
'hasdst' => false ),
'AST' => array(
'offset' => -32400000,
'longname' => 'Alaska Standard Time',
'shortname' => 'AKST',
'hasdst' => true,
'dstlongname' => 'Alaska Daylight Time',
'dstshortname' => 'AKDT' ),
'America/Anchorage' => array(
'offset' => -32400000,
'longname' => 'Alaska Standard Time',
'shortname' => 'AKST',
'hasdst' => true,
'dstlongname' => 'Alaska Daylight Time',
'dstshortname' => 'AKDT' ),
'America/Juneau' => array(
'offset' => -32400000,
'longname' => 'Alaska Standard Time',
'shortname' => 'AKST',
'hasdst' => true,
'dstlongname' => 'Alaska Daylight Time',
'dstshortname' => 'AKDT' ),
'America/Nome' => array(
'offset' => -32400000,
'longname' => 'Alaska Standard Time',
'shortname' => 'AKST',
'hasdst' => true,
'dstlongname' => 'Alaska Daylight Time',
'dstshortname' => 'AKDT' ),
'America/Yakutat' => array(
'offset' => -32400000,
'longname' => 'Alaska Standard Time',
'shortname' => 'AKST',
'hasdst' => true,
'dstlongname' => 'Alaska Daylight Time',
'dstshortname' => 'AKDT' ),
'Etc/GMT+9' => array(
'offset' => -32400000,
'longname' => 'GMT-09:00',
'shortname' => 'GMT-09:00',
'hasdst' => false ),
'Pacific/Gambier' => array(
'offset' => -32400000,
'longname' => 'Gambier Time',
'shortname' => 'GAMT',
'hasdst' => false ),
'SystemV/YST9' => array(
'offset' => -32400000,
'longname' => 'Gambier Time',
'shortname' => 'GAMT',
'hasdst' => false ),
'SystemV/YST9YDT' => array(
'offset' => -32400000,
'longname' => 'Alaska Standard Time',
'shortname' => 'AKST',
'hasdst' => true,
'dstlongname' => 'Alaska Daylight Time',
'dstshortname' => 'AKDT' ),
'US/Alaska' => array(
'offset' => -32400000,
'longname' => 'Alaska Standard Time',
'shortname' => 'AKST',
'hasdst' => true,
'dstlongname' => 'Alaska Daylight Time',
'dstshortname' => 'AKDT' ),
'America/Dawson' => array(
'offset' => -28800000,
'longname' => 'Pacific Standard Time',
'shortname' => 'PST',
'hasdst' => true,
'dstlongname' => 'Pacific Daylight Time',
'dstshortname' => 'PDT' ),
'America/Ensenada' => array(
'offset' => -28800000,
'longname' => 'Pacific Standard Time',
'shortname' => 'PST',
'hasdst' => true,
'dstlongname' => 'Pacific Daylight Time',
'dstshortname' => 'PDT' ),
'America/Los_Angeles' => array(
'offset' => -28800000,
'longname' => 'Pacific Standard Time',
'shortname' => 'PST',
'hasdst' => true,
'dstlongname' => 'Pacific Daylight Time',
'dstshortname' => 'PDT' ),
'America/Tijuana' => array(
'offset' => -28800000,
'longname' => 'Pacific Standard Time',
'shortname' => 'PST',
'hasdst' => true,
'dstlongname' => 'Pacific Daylight Time',
'dstshortname' => 'PDT' ),
'America/Vancouver' => array(
'offset' => -28800000,
'longname' => 'Pacific Standard Time',
'shortname' => 'PST',
'hasdst' => true,
'dstlongname' => 'Pacific Daylight Time',
'dstshortname' => 'PDT' ),
'America/Whitehorse' => array(
'offset' => -28800000,
'longname' => 'Pacific Standard Time',
'shortname' => 'PST',
'hasdst' => true,
'dstlongname' => 'Pacific Daylight Time',
'dstshortname' => 'PDT' ),
'Canada/Pacific' => array(
'offset' => -28800000,
'longname' => 'Pacific Standard Time',
'shortname' => 'PST',
'hasdst' => true,
'dstlongname' => 'Pacific Daylight Time',
'dstshortname' => 'PDT' ),
'Canada/Yukon' => array(
'offset' => -28800000,
'longname' => 'Pacific Standard Time',
'shortname' => 'PST',
'hasdst' => true,
'dstlongname' => 'Pacific Daylight Time',
'dstshortname' => 'PDT' ),
'Etc/GMT+8' => array(
'offset' => -28800000,
'longname' => 'GMT-08:00',
'shortname' => 'GMT-08:00',
'hasdst' => false ),
'Mexico/BajaNorte' => array(
'offset' => -28800000,
'longname' => 'Pacific Standard Time',
'shortname' => 'PST',
'hasdst' => true,
'dstlongname' => 'Pacific Daylight Time',
'dstshortname' => 'PDT' ),
'PST' => array(
'offset' => -28800000,
'longname' => 'Pacific Standard Time',
'shortname' => 'PST',
'hasdst' => true,
'dstlongname' => 'Pacific Daylight Time',
'dstshortname' => 'PDT' ),
'PST8PDT' => array(
'offset' => -28800000,
'longname' => 'Pacific Standard Time',
'shortname' => 'PST',
'hasdst' => true,
'dstlongname' => 'Pacific Daylight Time',
'dstshortname' => 'PDT' ),
'Pacific/Pitcairn' => array(
'offset' => -28800000,
'longname' => 'Pitcairn Standard Time',
'shortname' => 'PST',
'hasdst' => false ),
'SystemV/PST8' => array(
'offset' => -28800000,
'longname' => 'Pitcairn Standard Time',
'shortname' => 'PST',
'hasdst' => false ),
'SystemV/PST8PDT' => array(
'offset' => -28800000,
'longname' => 'Pacific Standard Time',
'shortname' => 'PST',
'hasdst' => true,
'dstlongname' => 'Pacific Daylight Time',
'dstshortname' => 'PDT' ),
'US/Pacific' => array(
'offset' => -28800000,
'longname' => 'Pacific Standard Time',
'shortname' => 'PST',
'hasdst' => true,
'dstlongname' => 'Pacific Daylight Time',
'dstshortname' => 'PDT' ),
'US/Pacific-New' => array(
'offset' => -28800000,
'longname' => 'Pacific Standard Time',
'shortname' => 'PST',
'hasdst' => true,
'dstlongname' => 'Pacific Daylight Time',
'dstshortname' => 'PDT' ),
'America/Boise' => array(
'offset' => -25200000,
'longname' => 'Mountain Standard Time',
'shortname' => 'MST',
'hasdst' => true,
'dstlongname' => 'Mountain Daylight Time',
'dstshortname' => 'MDT' ),
'America/Cambridge_Bay' => array(
'offset' => -25200000,
'longname' => 'Mountain Standard Time',
'shortname' => 'MST',
'hasdst' => true,
'dstlongname' => 'Mountain Daylight Time',
'dstshortname' => 'MDT' ),
'America/Chihuahua' => array(
'offset' => -25200000,
'longname' => 'Mountain Standard Time',
'shortname' => 'MST',
'hasdst' => true,
'dstlongname' => 'Mountain Daylight Time',
'dstshortname' => 'MDT' ),
'America/Dawson_Creek' => array(
'offset' => -25200000,
'longname' => 'Mountain Standard Time',
'shortname' => 'MST',
'hasdst' => false ),
'America/Denver' => array(
'offset' => -25200000,
'longname' => 'Mountain Standard Time',
'shortname' => 'MST',
'hasdst' => true,
'dstlongname' => 'Mountain Daylight Time',
'dstshortname' => 'MDT' ),
'America/Edmonton' => array(
'offset' => -25200000,
'longname' => 'Mountain Standard Time',
'shortname' => 'MST',
'hasdst' => true,
'dstlongname' => 'Mountain Daylight Time',
'dstshortname' => 'MDT' ),
'America/Hermosillo' => array(
'offset' => -25200000,
'longname' => 'Mountain Standard Time',
'shortname' => 'MST',
'hasdst' => false ),
'America/Inuvik' => array(
'offset' => -25200000,
'longname' => 'Mountain Standard Time',
'shortname' => 'MST',
'hasdst' => true,
'dstlongname' => 'Mountain Daylight Time',
'dstshortname' => 'MDT' ),
'America/Mazatlan' => array(
'offset' => -25200000,
'longname' => 'Mountain Standard Time',
'shortname' => 'MST',
'hasdst' => true,
'dstlongname' => 'Mountain Daylight Time',
'dstshortname' => 'MDT' ),
'America/Phoenix' => array(
'offset' => -25200000,
'longname' => 'Mountain Standard Time',
'shortname' => 'MST',
'hasdst' => false ),
'America/Shiprock' => array(
'offset' => -25200000,
'longname' => 'Mountain Standard Time',
'shortname' => 'MST',
'hasdst' => true,
'dstlongname' => 'Mountain Daylight Time',
'dstshortname' => 'MDT' ),
'America/Yellowknife' => array(
'offset' => -25200000,
'longname' => 'Mountain Standard Time',
'shortname' => 'MST',
'hasdst' => true,
'dstlongname' => 'Mountain Daylight Time',
'dstshortname' => 'MDT' ),
'Canada/Mountain' => array(
'offset' => -25200000,
'longname' => 'Mountain Standard Time',
'shortname' => 'MST',
'hasdst' => true,
'dstlongname' => 'Mountain Daylight Time',
'dstshortname' => 'MDT' ),
'Etc/GMT+7' => array(
'offset' => -25200000,
'longname' => 'GMT-07:00',
'shortname' => 'GMT-07:00',
'hasdst' => false ),
'MST' => array(
'offset' => -25200000,
'longname' => 'Mountain Standard Time',
'shortname' => 'MST',
'hasdst' => true,
'dstlongname' => 'Mountain Daylight Time',
'dstshortname' => 'MDT' ),
'MST7MDT' => array(
'offset' => -25200000,
'longname' => 'Mountain Standard Time',
'shortname' => 'MST',
'hasdst' => true,
'dstlongname' => 'Mountain Daylight Time',
'dstshortname' => 'MDT' ),
'Mexico/BajaSur' => array(
'offset' => -25200000,
'longname' => 'Mountain Standard Time',
'shortname' => 'MST',
'hasdst' => true,
'dstlongname' => 'Mountain Daylight Time',
'dstshortname' => 'MDT' ),
'Navajo' => array(
'offset' => -25200000,
'longname' => 'Mountain Standard Time',
'shortname' => 'MST',
'hasdst' => true,
'dstlongname' => 'Mountain Daylight Time',
'dstshortname' => 'MDT' ),
'PNT' => array(
'offset' => -25200000,
'longname' => 'Mountain Standard Time',
'shortname' => 'MST',
'hasdst' => false ),
'SystemV/MST7' => array(
'offset' => -25200000,
'longname' => 'Mountain Standard Time',
'shortname' => 'MST',
'hasdst' => false ),
'SystemV/MST7MDT' => array(
'offset' => -25200000,
'longname' => 'Mountain Standard Time',
'shortname' => 'MST',
'hasdst' => true,
'dstlongname' => 'Mountain Daylight Time',
'dstshortname' => 'MDT' ),
'US/Arizona' => array(
'offset' => -25200000,
'longname' => 'Mountain Standard Time',
'shortname' => 'MST',
'hasdst' => false ),
'US/Mountain' => array(
'offset' => -25200000,
'longname' => 'Mountain Standard Time',
'shortname' => 'MST',
'hasdst' => true,
'dstlongname' => 'Mountain Daylight Time',
'dstshortname' => 'MDT' ),
'America/Belize' => array(
'offset' => -21600000,
'longname' => 'Central Standard Time',
'shortname' => 'CST',
'hasdst' => false ),
'America/Cancun' => array(
'offset' => -21600000,
'longname' => 'Central Standard Time',
'shortname' => 'CST',
'hasdst' => true,
'dstlongname' => 'Central Daylight Time',
'dstshortname' => 'CDT' ),
'America/Chicago' => array(
'offset' => -21600000,
'longname' => 'Central Standard Time',
'shortname' => 'CST',
'hasdst' => true,
'dstlongname' => 'Central Daylight Time',
'dstshortname' => 'CDT' ),
'America/Costa_Rica' => array(
'offset' => -21600000,
'longname' => 'Central Standard Time',
'shortname' => 'CST',
'hasdst' => false ),
'America/El_Salvador' => array(
'offset' => -21600000,
'longname' => 'Central Standard Time',
'shortname' => 'CST',
'hasdst' => false ),
'America/Guatemala' => array(
'offset' => -21600000,
'longname' => 'Central Standard Time',
'shortname' => 'CST',
'hasdst' => false ),
'America/Managua' => array(
'offset' => -21600000,
'longname' => 'Central Standard Time',
'shortname' => 'CST',
'hasdst' => false ),
'America/Menominee' => array(
'offset' => -21600000,
'longname' => 'Central Standard Time',
'shortname' => 'CST',
'hasdst' => true,
'dstlongname' => 'Central Daylight Time',
'dstshortname' => 'CDT' ),
'America/Merida' => array(
'offset' => -21600000,
'longname' => 'Central Standard Time',
'shortname' => 'CST',
'hasdst' => true,
'dstlongname' => 'Central Daylight Time',
'dstshortname' => 'CDT' ),
'America/Mexico_City' => array(
'offset' => -21600000,
'longname' => 'Central Standard Time',
'shortname' => 'CST',
'hasdst' => false ),
'America/Monterrey' => array(
'offset' => -21600000,
'longname' => 'Central Standard Time',
'shortname' => 'CST',
'hasdst' => true,
'dstlongname' => 'Central Daylight Time',
'dstshortname' => 'CDT' ),
'America/North_Dakota/Center' => array(
'offset' => -21600000,
'longname' => 'Central Standard Time',
'shortname' => 'CST',
'hasdst' => true,
'dstlongname' => 'Central Daylight Time',
'dstshortname' => 'CDT' ),
'America/Rainy_River' => array(
'offset' => -21600000,
'longname' => 'Central Standard Time',
'shortname' => 'CST',
'hasdst' => true,
'dstlongname' => 'Central Daylight Time',
'dstshortname' => 'CDT' ),
'America/Rankin_Inlet' => array(
'offset' => -21600000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Daylight Time',
'dstshortname' => 'EDT' ),
'America/Regina' => array(
'offset' => -21600000,
'longname' => 'Central Standard Time',
'shortname' => 'CST',
'hasdst' => false ),
'America/Swift_Current' => array(
'offset' => -21600000,
'longname' => 'Central Standard Time',
'shortname' => 'CST',
'hasdst' => false ),
'America/Tegucigalpa' => array(
'offset' => -21600000,
'longname' => 'Central Standard Time',
'shortname' => 'CST',
'hasdst' => false ),
'America/Winnipeg' => array(
'offset' => -21600000,
'longname' => 'Central Standard Time',
'shortname' => 'CST',
'hasdst' => true,
'dstlongname' => 'Central Daylight Time',
'dstshortname' => 'CDT' ),
'CST' => array(
'offset' => -21600000,
'longname' => 'Central Standard Time',
'shortname' => 'CST',
'hasdst' => true,
'dstlongname' => 'Central Daylight Time',
'dstshortname' => 'CDT' ),
'CST6CDT' => array(
'offset' => -21600000,
'longname' => 'Central Standard Time',
'shortname' => 'CST',
'hasdst' => true,
'dstlongname' => 'Central Daylight Time',
'dstshortname' => 'CDT' ),
'Canada/Central' => array(
'offset' => -21600000,
'longname' => 'Central Standard Time',
'shortname' => 'CST',
'hasdst' => true,
'dstlongname' => 'Central Daylight Time',
'dstshortname' => 'CDT' ),
'Canada/East-Saskatchewan' => array(
'offset' => -21600000,
'longname' => 'Central Standard Time',
'shortname' => 'CST',
'hasdst' => false ),
'Canada/Saskatchewan' => array(
'offset' => -21600000,
'longname' => 'Central Standard Time',
'shortname' => 'CST',
'hasdst' => false ),
'Chile/EasterIsland' => array(
'offset' => -21600000,
'longname' => 'Easter Is. Time',
'shortname' => 'EAST',
'hasdst' => true,
'dstlongname' => 'Easter Is. Summer Time',
'dstshortname' => 'EASST' ),
'Etc/GMT+6' => array(
'offset' => -21600000,
'longname' => 'GMT-06:00',
'shortname' => 'GMT-06:00',
'hasdst' => false ),
'Mexico/General' => array(
'offset' => -21600000,
'longname' => 'Central Standard Time',
'shortname' => 'CST',
'hasdst' => false ),
'Pacific/Easter' => array(
'offset' => -21600000,
'longname' => 'Easter Is. Time',
'shortname' => 'EAST',
'hasdst' => true,
'dstlongname' => 'Easter Is. Summer Time',
'dstshortname' => 'EASST' ),
'Pacific/Galapagos' => array(
'offset' => -21600000,
'longname' => 'Galapagos Time',
'shortname' => 'GALT',
'hasdst' => false ),
'SystemV/CST6' => array(
'offset' => -21600000,
'longname' => 'Central Standard Time',
'shortname' => 'CST',
'hasdst' => false ),
'SystemV/CST6CDT' => array(
'offset' => -21600000,
'longname' => 'Central Standard Time',
'shortname' => 'CST',
'hasdst' => true,
'dstlongname' => 'Central Daylight Time',
'dstshortname' => 'CDT' ),
'US/Central' => array(
'offset' => -21600000,
'longname' => 'Central Standard Time',
'shortname' => 'CST',
'hasdst' => true,
'dstlongname' => 'Central Daylight Time',
'dstshortname' => 'CDT' ),
'America/Bogota' => array(
'offset' => -18000000,
'longname' => 'Colombia Time',
'shortname' => 'COT',
'hasdst' => false ),
'America/Cayman' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => false ),
'America/Detroit' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Daylight Time',
'dstshortname' => 'EDT' ),
'America/Eirunepe' => array(
'offset' => -18000000,
'longname' => 'Acre Time',
'shortname' => 'ACT',
'hasdst' => false ),
'America/Fort_Wayne' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => false ),
'America/Grand_Turk' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Daylight Time',
'dstshortname' => 'EDT' ),
'America/Guayaquil' => array(
'offset' => -18000000,
'longname' => 'Ecuador Time',
'shortname' => 'ECT',
'hasdst' => false ),
'America/Havana' => array(
'offset' => -18000000,
'longname' => 'Central Standard Time',
'shortname' => 'CST',
'hasdst' => true,
'dstlongname' => 'Central Daylight Time',
'dstshortname' => 'CDT' ),
'America/Indiana/Indianapolis' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => false ),
'America/Indiana/Knox' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => false ),
'America/Indiana/Marengo' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => false ),
'America/Indiana/Vevay' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => false ),
'America/Indianapolis' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => false ),
'America/Iqaluit' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Daylight Time',
'dstshortname' => 'EDT' ),
'America/Jamaica' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => false ),
'America/Kentucky/Louisville' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Daylight Time',
'dstshortname' => 'EDT' ),
'America/Kentucky/Monticello' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Daylight Time',
'dstshortname' => 'EDT' ),
'America/Knox_IN' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => false ),
'America/Lima' => array(
'offset' => -18000000,
'longname' => 'Peru Time',
'shortname' => 'PET',
'hasdst' => false ),
'America/Louisville' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Daylight Time',
'dstshortname' => 'EDT' ),
'America/Montreal' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Daylight Time',
'dstshortname' => 'EDT' ),
'America/Nassau' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Daylight Time',
'dstshortname' => 'EDT' ),
'America/New_York' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Daylight Time',
'dstshortname' => 'EDT' ),
'America/Nipigon' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Daylight Time',
'dstshortname' => 'EDT' ),
'America/Panama' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => false ),
'America/Pangnirtung' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Daylight Time',
'dstshortname' => 'EDT' ),
'America/Port-au-Prince' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => false ),
'America/Porto_Acre' => array(
'offset' => -18000000,
'longname' => 'Acre Time',
'shortname' => 'ACT',
'hasdst' => false ),
'America/Rio_Branco' => array(
'offset' => -18000000,
'longname' => 'Acre Time',
'shortname' => 'ACT',
'hasdst' => false ),
'America/Thunder_Bay' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Daylight Time',
'dstshortname' => 'EDT' ),
'Brazil/Acre' => array(
'offset' => -18000000,
'longname' => 'Acre Time',
'shortname' => 'ACT',
'hasdst' => false ),
'Canada/Eastern' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Daylight Time',
'dstshortname' => 'EDT' ),
'Cuba' => array(
'offset' => -18000000,
'longname' => 'Central Standard Time',
'shortname' => 'CST',
'hasdst' => true,
'dstlongname' => 'Central Daylight Time',
'dstshortname' => 'CDT' ),
'EST' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Daylight Time',
'dstshortname' => 'EDT' ),
'EST5EDT' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Daylight Time',
'dstshortname' => 'EDT' ),
'Etc/GMT+5' => array(
'offset' => -18000000,
'longname' => 'GMT-05:00',
'shortname' => 'GMT-05:00',
'hasdst' => false ),
'IET' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => false ),
'Jamaica' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => false ),
'SystemV/EST5' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => false ),
'SystemV/EST5EDT' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Daylight Time',
'dstshortname' => 'EDT' ),
'US/East-Indiana' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => false ),
'US/Eastern' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Daylight Time',
'dstshortname' => 'EDT' ),
'US/Indiana-Starke' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => false ),
'US/Michigan' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Daylight Time',
'dstshortname' => 'EDT' ),
'America/Anguilla' => array(
'offset' => -14400000,
'longname' => 'Atlantic Standard Time',
'shortname' => 'AST',
'hasdst' => false ),
'America/Antigua' => array(
'offset' => -14400000,
'longname' => 'Atlantic Standard Time',
'shortname' => 'AST',
'hasdst' => false ),
'America/Aruba' => array(
'offset' => -14400000,
'longname' => 'Atlantic Standard Time',
'shortname' => 'AST',
'hasdst' => false ),
'America/Asuncion' => array(
'offset' => -14400000,
'longname' => 'Paraguay Time',
'shortname' => 'PYT',
'hasdst' => true,
'dstlongname' => 'Paraguay Summer Time',
'dstshortname' => 'PYST' ),
'America/Barbados' => array(
'offset' => -14400000,
'longname' => 'Atlantic Standard Time',
'shortname' => 'AST',
'hasdst' => false ),
'America/Boa_Vista' => array(
'offset' => -14400000,
'longname' => 'Amazon Standard Time',
'shortname' => 'AMT',
'hasdst' => false ),
'America/Caracas' => array(
'offset' => -14400000,
'longname' => 'Venezuela Time',
'shortname' => 'VET',
'hasdst' => false ),
'America/Cuiaba' => array(
'offset' => -14400000,
'longname' => 'Amazon Standard Time',
'shortname' => 'AMT',
'hasdst' => true,
'dstlongname' => 'Amazon Summer Time',
'dstshortname' => 'AMST' ),
'America/Curacao' => array(
'offset' => -14400000,
'longname' => 'Atlantic Standard Time',
'shortname' => 'AST',
'hasdst' => false ),
'America/Dominica' => array(
'offset' => -14400000,
'longname' => 'Atlantic Standard Time',
'shortname' => 'AST',
'hasdst' => false ),
'America/Glace_Bay' => array(
'offset' => -14400000,
'longname' => 'Atlantic Standard Time',
'shortname' => 'AST',
'hasdst' => true,
'dstlongname' => 'Atlantic Daylight Time',
'dstshortname' => 'ADT' ),
'America/Goose_Bay' => array(
'offset' => -14400000,
'longname' => 'Atlantic Standard Time',
'shortname' => 'AST',
'hasdst' => true,
'dstlongname' => 'Atlantic Daylight Time',
'dstshortname' => 'ADT' ),
'America/Grenada' => array(
'offset' => -14400000,
'longname' => 'Atlantic Standard Time',
'shortname' => 'AST',
'hasdst' => false ),
'America/Guadeloupe' => array(
'offset' => -14400000,
'longname' => 'Atlantic Standard Time',
'shortname' => 'AST',
'hasdst' => false ),
'America/Guyana' => array(
'offset' => -14400000,
'longname' => 'Guyana Time',
'shortname' => 'GYT',
'hasdst' => false ),
'America/Halifax' => array(
'offset' => -14400000,
'longname' => 'Atlantic Standard Time',
'shortname' => 'AST',
'hasdst' => true,
'dstlongname' => 'Atlantic Daylight Time',
'dstshortname' => 'ADT' ),
'America/La_Paz' => array(
'offset' => -14400000,
'longname' => 'Bolivia Time',
'shortname' => 'BOT',
'hasdst' => false ),
'America/Manaus' => array(
'offset' => -14400000,
'longname' => 'Amazon Standard Time',
'shortname' => 'AMT',
'hasdst' => false ),
'America/Martinique' => array(
'offset' => -14400000,
'longname' => 'Atlantic Standard Time',
'shortname' => 'AST',
'hasdst' => false ),
'America/Montserrat' => array(
'offset' => -14400000,
'longname' => 'Atlantic Standard Time',
'shortname' => 'AST',
'hasdst' => false ),
'America/Port_of_Spain' => array(
'offset' => -14400000,
'longname' => 'Atlantic Standard Time',
'shortname' => 'AST',
'hasdst' => false ),
'America/Porto_Velho' => array(
'offset' => -14400000,
'longname' => 'Amazon Standard Time',
'shortname' => 'AMT',
'hasdst' => false ),
'America/Puerto_Rico' => array(
'offset' => -14400000,
'longname' => 'Atlantic Standard Time',
'shortname' => 'AST',
'hasdst' => false ),
'America/Santiago' => array(
'offset' => -14400000,
'longname' => 'Chile Time',
'shortname' => 'CLT',
'hasdst' => true,
'dstlongname' => 'Chile Summer Time',
'dstshortname' => 'CLST' ),
'America/Santo_Domingo' => array(
'offset' => -14400000,
'longname' => 'Atlantic Standard Time',
'shortname' => 'AST',
'hasdst' => false ),
'America/St_Kitts' => array(
'offset' => -14400000,
'longname' => 'Atlantic Standard Time',
'shortname' => 'AST',
'hasdst' => false ),
'America/St_Lucia' => array(
'offset' => -14400000,
'longname' => 'Atlantic Standard Time',
'shortname' => 'AST',
'hasdst' => false ),
'America/St_Thomas' => array(
'offset' => -14400000,
'longname' => 'Atlantic Standard Time',
'shortname' => 'AST',
'hasdst' => false ),
'America/St_Vincent' => array(
'offset' => -14400000,
'longname' => 'Atlantic Standard Time',
'shortname' => 'AST',
'hasdst' => false ),
'America/Thule' => array(
'offset' => -14400000,
'longname' => 'Atlantic Standard Time',
'shortname' => 'AST',
'hasdst' => false ),
'America/Tortola' => array(
'offset' => -14400000,
'longname' => 'Atlantic Standard Time',
'shortname' => 'AST',
'hasdst' => false ),
'America/Virgin' => array(
'offset' => -14400000,
'longname' => 'Atlantic Standard Time',
'shortname' => 'AST',
'hasdst' => false ),
'Antarctica/Palmer' => array(
'offset' => -14400000,
'longname' => 'Chile Time',
'shortname' => 'CLT',
'hasdst' => true,
'dstlongname' => 'Chile Summer Time',
'dstshortname' => 'CLST' ),
'Atlantic/Bermuda' => array(
'offset' => -14400000,
'longname' => 'Atlantic Standard Time',
'shortname' => 'AST',
'hasdst' => true,
'dstlongname' => 'Atlantic Daylight Time',
'dstshortname' => 'ADT' ),
'Atlantic/Stanley' => array(
'offset' => -14400000,
'longname' => 'Falkland Is. Time',
'shortname' => 'FKT',
'hasdst' => true,
'dstlongname' => 'Falkland Is. Summer Time',
'dstshortname' => 'FKST' ),
'Brazil/West' => array(
'offset' => -14400000,
'longname' => 'Amazon Standard Time',
'shortname' => 'AMT',
'hasdst' => false ),
'Canada/Atlantic' => array(
'offset' => -14400000,
'longname' => 'Atlantic Standard Time',
'shortname' => 'AST',
'hasdst' => true,
'dstlongname' => 'Atlantic Daylight Time',
'dstshortname' => 'ADT' ),
'Chile/Continental' => array(
'offset' => -14400000,
'longname' => 'Chile Time',
'shortname' => 'CLT',
'hasdst' => true,
'dstlongname' => 'Chile Summer Time',
'dstshortname' => 'CLST' ),
'Etc/GMT+4' => array(
'offset' => -14400000,
'longname' => 'GMT-04:00',
'shortname' => 'GMT-04:00',
'hasdst' => false ),
'PRT' => array(
'offset' => -14400000,
'longname' => 'Atlantic Standard Time',
'shortname' => 'AST',
'hasdst' => false ),
'SystemV/AST4' => array(
'offset' => -14400000,
'longname' => 'Atlantic Standard Time',
'shortname' => 'AST',
'hasdst' => false ),
'SystemV/AST4ADT' => array(
'offset' => -14400000,
'longname' => 'Atlantic Standard Time',
'shortname' => 'AST',
'hasdst' => true,
'dstlongname' => 'Atlantic Daylight Time',
'dstshortname' => 'ADT' ),
'America/St_Johns' => array(
'offset' => -12600000,
'longname' => 'Newfoundland Standard Time',
'shortname' => 'NST',
'hasdst' => true,
'dstlongname' => 'Newfoundland Daylight Time',
'dstshortname' => 'NDT' ),
'CNT' => array(
'offset' => -12600000,
'longname' => 'Newfoundland Standard Time',
'shortname' => 'NST',
'hasdst' => true,
'dstlongname' => 'Newfoundland Daylight Time',
'dstshortname' => 'NDT' ),
'Canada/Newfoundland' => array(
'offset' => -12600000,
'longname' => 'Newfoundland Standard Time',
'shortname' => 'NST',
'hasdst' => true,
'dstlongname' => 'Newfoundland Daylight Time',
'dstshortname' => 'NDT' ),
'AGT' => array(
'offset' => -10800000,
'longname' => 'Argentine Time',
'shortname' => 'ART',
'hasdst' => false ),
'America/Araguaina' => array(
'offset' => -10800000,
'longname' => 'Brazil Time',
'shortname' => 'BRT',
'hasdst' => true,
'dstlongname' => 'Brazil Summer Time',
'dstshortname' => 'BRST' ),
'America/Belem' => array(
'offset' => -10800000,
'longname' => 'Brazil Time',
'shortname' => 'BRT',
'hasdst' => false ),
'America/Buenos_Aires' => array(
'offset' => -10800000,
'longname' => 'Argentine Time',
'shortname' => 'ART',
'hasdst' => false ),
'America/Catamarca' => array(
'offset' => -10800000,
'longname' => 'Argentine Time',
'shortname' => 'ART',
'hasdst' => false ),
'America/Cayenne' => array(
'offset' => -10800000,
'longname' => 'French Guiana Time',
'shortname' => 'GFT',
'hasdst' => false ),
'America/Cordoba' => array(
'offset' => -10800000,
'longname' => 'Argentine Time',
'shortname' => 'ART',
'hasdst' => false ),
'America/Fortaleza' => array(
'offset' => -10800000,
'longname' => 'Brazil Time',
'shortname' => 'BRT',
'hasdst' => true,
'dstlongname' => 'Brazil Summer Time',
'dstshortname' => 'BRST' ),
'America/Godthab' => array(
'offset' => -10800000,
'longname' => 'Western Greenland Time',
'shortname' => 'WGT',
'hasdst' => true,
'dstlongname' => 'Western Greenland Summer Time',
'dstshortname' => 'WGST' ),
'America/Jujuy' => array(
'offset' => -10800000,
'longname' => 'Argentine Time',
'shortname' => 'ART',
'hasdst' => false ),
'America/Maceio' => array(
'offset' => -10800000,
'longname' => 'Brazil Time',
'shortname' => 'BRT',
'hasdst' => true,
'dstlongname' => 'Brazil Summer Time',
'dstshortname' => 'BRST' ),
'America/Mendoza' => array(
'offset' => -10800000,
'longname' => 'Argentine Time',
'shortname' => 'ART',
'hasdst' => false ),
'America/Miquelon' => array(
'offset' => -10800000,
'longname' => 'Pierre & Miquelon Standard Time',
'shortname' => 'PMST',
'hasdst' => true,
'dstlongname' => 'Pierre & Miquelon Daylight Time',
'dstshortname' => 'PMDT' ),
'America/Montevideo' => array(
'offset' => -10800000,
'longname' => 'Uruguay Time',
'shortname' => 'UYT',
'hasdst' => false ),
'America/Paramaribo' => array(
'offset' => -10800000,
'longname' => 'Suriname Time',
'shortname' => 'SRT',
'hasdst' => false ),
'America/Recife' => array(
'offset' => -10800000,
'longname' => 'Brazil Time',
'shortname' => 'BRT',
'hasdst' => true,
'dstlongname' => 'Brazil Summer Time',
'dstshortname' => 'BRST' ),
'America/Rosario' => array(
'offset' => -10800000,
'longname' => 'Argentine Time',
'shortname' => 'ART',
'hasdst' => false ),
'America/Sao_Paulo' => array(
'offset' => -10800000,
'longname' => 'Brazil Time',
'shortname' => 'BRT',
'hasdst' => true,
'dstlongname' => 'Brazil Summer Time',
'dstshortname' => 'BRST' ),
'BET' => array(
'offset' => -10800000,
'longname' => 'Brazil Time',
'shortname' => 'BRT',
'hasdst' => true,
'dstlongname' => 'Brazil Summer Time',
'dstshortname' => 'BRST' ),
'Brazil/East' => array(
'offset' => -10800000,
'longname' => 'Brazil Time',
'shortname' => 'BRT',
'hasdst' => true,
'dstlongname' => 'Brazil Summer Time',
'dstshortname' => 'BRST' ),
'Etc/GMT+3' => array(
'offset' => -10800000,
'longname' => 'GMT-03:00',
'shortname' => 'GMT-03:00',
'hasdst' => false ),
'America/Noronha' => array(
'offset' => -7200000,
'longname' => 'Fernando de Noronha Time',
'shortname' => 'FNT',
'hasdst' => false ),
'Atlantic/South_Georgia' => array(
'offset' => -7200000,
'longname' => 'South Georgia Standard Time',
'shortname' => 'GST',
'hasdst' => false ),
'Brazil/DeNoronha' => array(
'offset' => -7200000,
'longname' => 'Fernando de Noronha Time',
'shortname' => 'FNT',
'hasdst' => false ),
'Etc/GMT+2' => array(
'offset' => -7200000,
'longname' => 'GMT-02:00',
'shortname' => 'GMT-02:00',
'hasdst' => false ),
'America/Scoresbysund' => array(
'offset' => -3600000,
'longname' => 'Eastern Greenland Time',
'shortname' => 'EGT',
'hasdst' => true,
'dstlongname' => 'Eastern Greenland Summer Time',
'dstshortname' => 'EGST' ),
'Atlantic/Azores' => array(
'offset' => -3600000,
'longname' => 'Azores Time',
'shortname' => 'AZOT',
'hasdst' => true,
'dstlongname' => 'Azores Summer Time',
'dstshortname' => 'AZOST' ),
'Atlantic/Cape_Verde' => array(
'offset' => -3600000,
'longname' => 'Cape Verde Time',
'shortname' => 'CVT',
'hasdst' => false ),
'Etc/GMT+1' => array(
'offset' => -3600000,
'longname' => 'GMT-01:00',
'shortname' => 'GMT-01:00',
'hasdst' => false ),
'Africa/Abidjan' => array(
'offset' => 0,
'longname' => 'Greenwich Mean Time',
'shortname' => 'GMT',
'hasdst' => false ),
'Africa/Accra' => array(
'offset' => 0,
'longname' => 'Greenwich Mean Time',
'shortname' => 'GMT',
'hasdst' => false ),
'Africa/Bamako' => array(
'offset' => 0,
'longname' => 'Greenwich Mean Time',
'shortname' => 'GMT',
'hasdst' => false ),
'Africa/Banjul' => array(
'offset' => 0,
'longname' => 'Greenwich Mean Time',
'shortname' => 'GMT',
'hasdst' => false ),
'Africa/Bissau' => array(
'offset' => 0,
'longname' => 'Greenwich Mean Time',
'shortname' => 'GMT',
'hasdst' => false ),
'Africa/Casablanca' => array(
'offset' => 0,
'longname' => 'Western European Time',
'shortname' => 'WET',
'hasdst' => false ),
'Africa/Conakry' => array(
'offset' => 0,
'longname' => 'Greenwich Mean Time',
'shortname' => 'GMT',
'hasdst' => false ),
'Africa/Dakar' => array(
'offset' => 0,
'longname' => 'Greenwich Mean Time',
'shortname' => 'GMT',
'hasdst' => false ),
'Africa/El_Aaiun' => array(
'offset' => 0,
'longname' => 'Western European Time',
'shortname' => 'WET',
'hasdst' => false ),
'Africa/Freetown' => array(
'offset' => 0,
'longname' => 'Greenwich Mean Time',
'shortname' => 'GMT',
'hasdst' => false ),
'Africa/Lome' => array(
'offset' => 0,
'longname' => 'Greenwich Mean Time',
'shortname' => 'GMT',
'hasdst' => false ),
'Africa/Monrovia' => array(
'offset' => 0,
'longname' => 'Greenwich Mean Time',
'shortname' => 'GMT',
'hasdst' => false ),
'Africa/Nouakchott' => array(
'offset' => 0,
'longname' => 'Greenwich Mean Time',
'shortname' => 'GMT',
'hasdst' => false ),
'Africa/Ouagadougou' => array(
'offset' => 0,
'longname' => 'Greenwich Mean Time',
'shortname' => 'GMT',
'hasdst' => false ),
'Africa/Sao_Tome' => array(
'offset' => 0,
'longname' => 'Greenwich Mean Time',
'shortname' => 'GMT',
'hasdst' => false ),
'Africa/Timbuktu' => array(
'offset' => 0,
'longname' => 'Greenwich Mean Time',
'shortname' => 'GMT',
'hasdst' => false ),
'America/Danmarkshavn' => array(
'offset' => 0,
'longname' => 'Greenwich Mean Time',
'shortname' => 'GMT',
'hasdst' => false ),
'Atlantic/Canary' => array(
'offset' => 0,
'longname' => 'Western European Time',
'shortname' => 'WET',
'hasdst' => true,
'dstlongname' => 'Western European Summer Time',
'dstshortname' => 'WEST' ),
'Atlantic/Faeroe' => array(
'offset' => 0,
'longname' => 'Western European Time',
'shortname' => 'WET',
'hasdst' => true,
'dstlongname' => 'Western European Summer Time',
'dstshortname' => 'WEST' ),
'Atlantic/Madeira' => array(
'offset' => 0,
'longname' => 'Western European Time',
'shortname' => 'WET',
'hasdst' => true,
'dstlongname' => 'Western European Summer Time',
'dstshortname' => 'WEST' ),
'Atlantic/Reykjavik' => array(
'offset' => 0,
'longname' => 'Greenwich Mean Time',
'shortname' => 'GMT',
'hasdst' => false ),
'Atlantic/St_Helena' => array(
'offset' => 0,
'longname' => 'Greenwich Mean Time',
'shortname' => 'GMT',
'hasdst' => false ),
'Eire' => array(
'offset' => 0,
'longname' => 'Greenwich Mean Time',
'shortname' => 'GMT',
'hasdst' => true,
'dstlongname' => 'Irish Summer Time',
'dstshortname' => 'IST' ),
'Etc/GMT' => array(
'offset' => 0,
'longname' => 'GMT+00:00',
'shortname' => 'GMT+00:00',
'hasdst' => false ),
'Etc/GMT+0' => array(
'offset' => 0,
'longname' => 'GMT+00:00',
'shortname' => 'GMT+00:00',
'hasdst' => false ),
'Etc/GMT-0' => array(
'offset' => 0,
'longname' => 'GMT+00:00',
'shortname' => 'GMT+00:00',
'hasdst' => false ),
'Etc/GMT0' => array(
'offset' => 0,
'longname' => 'GMT+00:00',
'shortname' => 'GMT+00:00',
'hasdst' => false ),
'Etc/Greenwich' => array(
'offset' => 0,
'longname' => 'Greenwich Mean Time',
'shortname' => 'GMT',
'hasdst' => false ),
'Etc/UCT' => array(
'offset' => 0,
'longname' => 'Coordinated Universal Time',
'shortname' => 'UTC',
'hasdst' => false ),
'Etc/UTC' => array(
'offset' => 0,
'longname' => 'Coordinated Universal Time',
'shortname' => 'UTC',
'hasdst' => false ),
'Etc/Universal' => array(
'offset' => 0,
'longname' => 'Coordinated Universal Time',
'shortname' => 'UTC',
'hasdst' => false ),
'Etc/Zulu' => array(
'offset' => 0,
'longname' => 'Coordinated Universal Time',
'shortname' => 'UTC',
'hasdst' => false ),
'Europe/Belfast' => array(
'offset' => 0,
'longname' => 'Greenwich Mean Time',
'shortname' => 'GMT',
'hasdst' => true,
'dstlongname' => 'British Summer Time',
'dstshortname' => 'BST' ),
'Europe/Dublin' => array(
'offset' => 0,
'longname' => 'Greenwich Mean Time',
'shortname' => 'GMT',
'hasdst' => true,
'dstlongname' => 'Irish Summer Time',
'dstshortname' => 'IST' ),
'Europe/Lisbon' => array(
'offset' => 0,
'longname' => 'Western European Time',
'shortname' => 'WET',
'hasdst' => true,
'dstlongname' => 'Western European Summer Time',
'dstshortname' => 'WEST' ),
'Europe/London' => array(
'offset' => 0,
'longname' => 'Greenwich Mean Time',
'shortname' => 'GMT',
'hasdst' => true,
'dstlongname' => 'British Summer Time',
'dstshortname' => 'BST' ),
'GB' => array(
'offset' => 0,
'longname' => 'Greenwich Mean Time',
'shortname' => 'GMT',
'hasdst' => true,
'dstlongname' => 'British Summer Time',
'dstshortname' => 'BST' ),
'GB-Eire' => array(
'offset' => 0,
'longname' => 'Greenwich Mean Time',
'shortname' => 'GMT',
'hasdst' => true,
'dstlongname' => 'British Summer Time',
'dstshortname' => 'BST' ),
'GMT' => array(
'offset' => 0,
'longname' => 'Greenwich Mean Time',
'shortname' => 'GMT',
'hasdst' => false ),
'GMT0' => array(
'offset' => 0,
'longname' => 'GMT+00:00',
'shortname' => 'GMT+00:00',
'hasdst' => false ),
'Greenwich' => array(
'offset' => 0,
'longname' => 'Greenwich Mean Time',
'shortname' => 'GMT',
'hasdst' => false ),
'Iceland' => array(
'offset' => 0,
'longname' => 'Greenwich Mean Time',
'shortname' => 'GMT',
'hasdst' => false ),
'Portugal' => array(
'offset' => 0,
'longname' => 'Western European Time',
'shortname' => 'WET',
'hasdst' => true,
'dstlongname' => 'Western European Summer Time',
'dstshortname' => 'WEST' ),
'UCT' => array(
'offset' => 0,
'longname' => 'Coordinated Universal Time',
'shortname' => 'UTC',
'hasdst' => false ),
'UTC' => array(
'offset' => 0,
'longname' => 'Coordinated Universal Time',
'shortname' => 'UTC',
'hasdst' => false ),
'Universal' => array(
'offset' => 0,
'longname' => 'Coordinated Universal Time',
'shortname' => 'UTC',
'hasdst' => false ),
'WET' => array(
'offset' => 0,
'longname' => 'Western European Time',
'shortname' => 'WET',
'hasdst' => true,
'dstlongname' => 'Western European Summer Time',
'dstshortname' => 'WEST' ),
'Zulu' => array(
'offset' => 0,
'longname' => 'Coordinated Universal Time',
'shortname' => 'UTC',
'hasdst' => false ),
'Africa/Algiers' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => false ),
'Africa/Bangui' => array(
'offset' => 3600000,
'longname' => 'Western African Time',
'shortname' => 'WAT',
'hasdst' => false ),
'Africa/Brazzaville' => array(
'offset' => 3600000,
'longname' => 'Western African Time',
'shortname' => 'WAT',
'hasdst' => false ),
'Africa/Ceuta' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Africa/Douala' => array(
'offset' => 3600000,
'longname' => 'Western African Time',
'shortname' => 'WAT',
'hasdst' => false ),
'Africa/Kinshasa' => array(
'offset' => 3600000,
'longname' => 'Western African Time',
'shortname' => 'WAT',
'hasdst' => false ),
'Africa/Lagos' => array(
'offset' => 3600000,
'longname' => 'Western African Time',
'shortname' => 'WAT',
'hasdst' => false ),
'Africa/Libreville' => array(
'offset' => 3600000,
'longname' => 'Western African Time',
'shortname' => 'WAT',
'hasdst' => false ),
'Africa/Luanda' => array(
'offset' => 3600000,
'longname' => 'Western African Time',
'shortname' => 'WAT',
'hasdst' => false ),
'Africa/Malabo' => array(
'offset' => 3600000,
'longname' => 'Western African Time',
'shortname' => 'WAT',
'hasdst' => false ),
'Africa/Ndjamena' => array(
'offset' => 3600000,
'longname' => 'Western African Time',
'shortname' => 'WAT',
'hasdst' => false ),
'Africa/Niamey' => array(
'offset' => 3600000,
'longname' => 'Western African Time',
'shortname' => 'WAT',
'hasdst' => false ),
'Africa/Porto-Novo' => array(
'offset' => 3600000,
'longname' => 'Western African Time',
'shortname' => 'WAT',
'hasdst' => false ),
'Africa/Tunis' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => false ),
'Africa/Windhoek' => array(
'offset' => 3600000,
'longname' => 'Western African Time',
'shortname' => 'WAT',
'hasdst' => true,
'dstlongname' => 'Western African Summer Time',
'dstshortname' => 'WAST' ),
'Arctic/Longyearbyen' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Atlantic/Jan_Mayen' => array(
'offset' => 3600000,
'longname' => 'Eastern Greenland Time',
'shortname' => 'EGT',
'hasdst' => true,
'dstlongname' => 'Eastern Greenland Summer Time',
'dstshortname' => 'EGST' ),
'CET' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'CEST' => array(
'offset' => 3600000,
'longname' => "Central European Time",
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => "Central European Summer Time",
'dstshortname' => 'CEST' ),
'ECT' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Etc/GMT-1' => array(
'offset' => 3600000,
'longname' => 'GMT+01:00',
'shortname' => 'GMT+01:00',
'hasdst' => false ),
'Europe/Amsterdam' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Europe/Andorra' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Europe/Belgrade' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Europe/Berlin' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Europe/Bratislava' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Europe/Brussels' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Europe/Budapest' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Europe/Copenhagen' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Europe/Gibraltar' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Europe/Ljubljana' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Europe/Luxembourg' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Europe/Madrid' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Europe/Malta' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Europe/Monaco' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Europe/Oslo' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Europe/Paris' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Europe/Prague' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Europe/Rome' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Europe/San_Marino' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Europe/Sarajevo' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Europe/Skopje' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Europe/Stockholm' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Europe/Tirane' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Europe/Vaduz' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Europe/Vatican' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Europe/Vienna' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Europe/Warsaw' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Europe/Zagreb' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Europe/Zurich' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'MET' => array(
'offset' => 3600000,
'longname' => 'Middle Europe Time',
'shortname' => 'MET',
'hasdst' => true,
'dstlongname' => 'Middle Europe Summer Time',
'dstshortname' => 'MEST' ),
'Poland' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'ART' => array(
'offset' => 7200000,
'longname' => 'Eastern European Time',
'shortname' => 'EET',
'hasdst' => true,
'dstlongname' => 'Eastern European Summer Time',
'dstshortname' => 'EEST' ),
'Africa/Blantyre' => array(
'offset' => 7200000,
'longname' => 'Central African Time',
'shortname' => 'CAT',
'hasdst' => false ),
'Africa/Bujumbura' => array(
'offset' => 7200000,
'longname' => 'Central African Time',
'shortname' => 'CAT',
'hasdst' => false ),
'Africa/Cairo' => array(
'offset' => 7200000,
'longname' => 'Eastern European Time',
'shortname' => 'EET',
'hasdst' => true,
'dstlongname' => 'Eastern European Summer Time',
'dstshortname' => 'EEST' ),
'Africa/Gaborone' => array(
'offset' => 7200000,
'longname' => 'Central African Time',
'shortname' => 'CAT',
'hasdst' => false ),
'Africa/Harare' => array(
'offset' => 7200000,
'longname' => 'Central African Time',
'shortname' => 'CAT',
'hasdst' => false ),
'Africa/Johannesburg' => array(
'offset' => 7200000,
'longname' => 'South Africa Standard Time',
'shortname' => 'SAST',
'hasdst' => false ),
'Africa/Kigali' => array(
'offset' => 7200000,
'longname' => 'Central African Time',
'shortname' => 'CAT',
'hasdst' => false ),
'Africa/Lubumbashi' => array(
'offset' => 7200000,
'longname' => 'Central African Time',
'shortname' => 'CAT',
'hasdst' => false ),
'Africa/Lusaka' => array(
'offset' => 7200000,
'longname' => 'Central African Time',
'shortname' => 'CAT',
'hasdst' => false ),
'Africa/Maputo' => array(
'offset' => 7200000,
'longname' => 'Central African Time',
'shortname' => 'CAT',
'hasdst' => false ),
'Africa/Maseru' => array(
'offset' => 7200000,
'longname' => 'South Africa Standard Time',
'shortname' => 'SAST',
'hasdst' => false ),
'Africa/Mbabane' => array(
'offset' => 7200000,
'longname' => 'South Africa Standard Time',
'shortname' => 'SAST',
'hasdst' => false ),
'Africa/Tripoli' => array(
'offset' => 7200000,
'longname' => 'Eastern European Time',
'shortname' => 'EET',
'hasdst' => false ),
'Asia/Amman' => array(
'offset' => 7200000,
'longname' => 'Eastern European Time',
'shortname' => 'EET',
'hasdst' => true,
'dstlongname' => 'Eastern European Summer Time',
'dstshortname' => 'EEST' ),
'Asia/Beirut' => array(
'offset' => 7200000,
'longname' => 'Eastern European Time',
'shortname' => 'EET',
'hasdst' => true,
'dstlongname' => 'Eastern European Summer Time',
'dstshortname' => 'EEST' ),
'Asia/Damascus' => array(
'offset' => 7200000,
'longname' => 'Eastern European Time',
'shortname' => 'EET',
'hasdst' => true,
'dstlongname' => 'Eastern European Summer Time',
'dstshortname' => 'EEST' ),
'Asia/Gaza' => array(
'offset' => 7200000,
'longname' => 'Eastern European Time',
'shortname' => 'EET',
'hasdst' => true,
'dstlongname' => 'Eastern European Summer Time',
'dstshortname' => 'EEST' ),
'Asia/Istanbul' => array(
'offset' => 7200000,
'longname' => 'Eastern European Time',
'shortname' => 'EET',
'hasdst' => true,
'dstlongname' => 'Eastern European Summer Time',
'dstshortname' => 'EEST' ),
'Asia/Jerusalem' => array(
'offset' => 7200000,
'longname' => 'Israel Standard Time',
'shortname' => 'IST',
'hasdst' => true,
'dstlongname' => 'Israel Daylight Time',
'dstshortname' => 'IDT' ),
'Asia/Nicosia' => array(
'offset' => 7200000,
'longname' => 'Eastern European Time',
'shortname' => 'EET',
'hasdst' => true,
'dstlongname' => 'Eastern European Summer Time',
'dstshortname' => 'EEST' ),
'Asia/Tel_Aviv' => array(
'offset' => 7200000,
'longname' => 'Israel Standard Time',
'shortname' => 'IST',
'hasdst' => true,
'dstlongname' => 'Israel Daylight Time',
'dstshortname' => 'IDT' ),
'CAT' => array(
'offset' => 7200000,
'longname' => 'Central African Time',
'shortname' => 'CAT',
'hasdst' => false ),
'EET' => array(
'offset' => 7200000,
'longname' => 'Eastern European Time',
'shortname' => 'EET',
'hasdst' => true,
'dstlongname' => 'Eastern European Summer Time',
'dstshortname' => 'EEST' ),
'Egypt' => array(
'offset' => 7200000,
'longname' => 'Eastern European Time',
'shortname' => 'EET',
'hasdst' => true,
'dstlongname' => 'Eastern European Summer Time',
'dstshortname' => 'EEST' ),
'Etc/GMT-2' => array(
'offset' => 7200000,
'longname' => 'GMT+02:00',
'shortname' => 'GMT+02:00',
'hasdst' => false ),
'Europe/Athens' => array(
'offset' => 7200000,
'longname' => 'Eastern European Time',
'shortname' => 'EET',
'hasdst' => true,
'dstlongname' => 'Eastern European Summer Time',
'dstshortname' => 'EEST' ),
'Europe/Bucharest' => array(
'offset' => 7200000,
'longname' => 'Eastern European Time',
'shortname' => 'EET',
'hasdst' => true,
'dstlongname' => 'Eastern European Summer Time',
'dstshortname' => 'EEST' ),
'Europe/Chisinau' => array(
'offset' => 7200000,
'longname' => 'Eastern European Time',
'shortname' => 'EET',
'hasdst' => true,
'dstlongname' => 'Eastern European Summer Time',
'dstshortname' => 'EEST' ),
'Europe/Helsinki' => array(
'offset' => 7200000,
'longname' => 'Eastern European Time',
'shortname' => 'EET',
'hasdst' => true,
'dstlongname' => 'Eastern European Summer Time',
'dstshortname' => 'EEST' ),
'Europe/Istanbul' => array(
'offset' => 7200000,
'longname' => 'Eastern European Time',
'shortname' => 'EET',
'hasdst' => true,
'dstlongname' => 'Eastern European Summer Time',
'dstshortname' => 'EEST' ),
'Europe/Kaliningrad' => array(
'offset' => 7200000,
'longname' => 'Eastern European Time',
'shortname' => 'EET',
'hasdst' => true,
'dstlongname' => 'Eastern European Summer Time',
'dstshortname' => 'EEST' ),
'Europe/Kiev' => array(
'offset' => 7200000,
'longname' => 'Eastern European Time',
'shortname' => 'EET',
'hasdst' => true,
'dstlongname' => 'Eastern European Summer Time',
'dstshortname' => 'EEST' ),
'Europe/Minsk' => array(
'offset' => 7200000,
'longname' => 'Eastern European Time',
'shortname' => 'EET',
'hasdst' => true,
'dstlongname' => 'Eastern European Summer Time',
'dstshortname' => 'EEST' ),
'Europe/Nicosia' => array(
'offset' => 7200000,
'longname' => 'Eastern European Time',
'shortname' => 'EET',
'hasdst' => true,
'dstlongname' => 'Eastern European Summer Time',
'dstshortname' => 'EEST' ),
'Europe/Riga' => array(
'offset' => 7200000,
'longname' => 'Eastern European Time',
'shortname' => 'EET',
'hasdst' => true,
'dstlongname' => 'Eastern European Summer Time',
'dstshortname' => 'EEST' ),
'Europe/Simferopol' => array(
'offset' => 7200000,
'longname' => 'Eastern European Time',
'shortname' => 'EET',
'hasdst' => true,
'dstlongname' => 'Eastern European Summer Time',
'dstshortname' => 'EEST' ),
'Europe/Sofia' => array(
'offset' => 7200000,
'longname' => 'Eastern European Time',
'shortname' => 'EET',
'hasdst' => true,
'dstlongname' => 'Eastern European Summer Time',
'dstshortname' => 'EEST' ),
'Europe/Tallinn' => array(
'offset' => 7200000,
'longname' => 'Eastern European Time',
'shortname' => 'EET',
'hasdst' => false ),
'Europe/Tiraspol' => array(
'offset' => 7200000,
'longname' => 'Eastern European Time',
'shortname' => 'EET',
'hasdst' => true,
'dstlongname' => 'Eastern European Summer Time',
'dstshortname' => 'EEST' ),
'Europe/Uzhgorod' => array(
'offset' => 7200000,
'longname' => 'Eastern European Time',
'shortname' => 'EET',
'hasdst' => true,
'dstlongname' => 'Eastern European Summer Time',
'dstshortname' => 'EEST' ),
'Europe/Vilnius' => array(
'offset' => 7200000,
'longname' => 'Eastern European Time',
'shortname' => 'EET',
'hasdst' => false ),
'Europe/Zaporozhye' => array(
'offset' => 7200000,
'longname' => 'Eastern European Time',
'shortname' => 'EET',
'hasdst' => true,
'dstlongname' => 'Eastern European Summer Time',
'dstshortname' => 'EEST' ),
'Israel' => array(
'offset' => 7200000,
'longname' => 'Israel Standard Time',
'shortname' => 'IST',
'hasdst' => true,
'dstlongname' => 'Israel Daylight Time',
'dstshortname' => 'IDT' ),
'Libya' => array(
'offset' => 7200000,
'longname' => 'Eastern European Time',
'shortname' => 'EET',
'hasdst' => false ),
'Turkey' => array(
'offset' => 7200000,
'longname' => 'Eastern European Time',
'shortname' => 'EET',
'hasdst' => true,
'dstlongname' => 'Eastern European Summer Time',
'dstshortname' => 'EEST' ),
'Africa/Addis_Ababa' => array(
'offset' => 10800000,
'longname' => 'Eastern African Time',
'shortname' => 'EAT',
'hasdst' => false ),
'Africa/Asmera' => array(
'offset' => 10800000,
'longname' => 'Eastern African Time',
'shortname' => 'EAT',
'hasdst' => false ),
'Africa/Dar_es_Salaam' => array(
'offset' => 10800000,
'longname' => 'Eastern African Time',
'shortname' => 'EAT',
'hasdst' => false ),
'Africa/Djibouti' => array(
'offset' => 10800000,
'longname' => 'Eastern African Time',
'shortname' => 'EAT',
'hasdst' => false ),
'Africa/Kampala' => array(
'offset' => 10800000,
'longname' => 'Eastern African Time',
'shortname' => 'EAT',
'hasdst' => false ),
'Africa/Khartoum' => array(
'offset' => 10800000,
'longname' => 'Eastern African Time',
'shortname' => 'EAT',
'hasdst' => false ),
'Africa/Mogadishu' => array(
'offset' => 10800000,
'longname' => 'Eastern African Time',
'shortname' => 'EAT',
'hasdst' => false ),
'Africa/Nairobi' => array(
'offset' => 10800000,
'longname' => 'Eastern African Time',
'shortname' => 'EAT',
'hasdst' => false ),
'Antarctica/Syowa' => array(
'offset' => 10800000,
'longname' => 'Syowa Time',
'shortname' => 'SYOT',
'hasdst' => false ),
'Asia/Aden' => array(
'offset' => 10800000,
'longname' => 'Arabia Standard Time',
'shortname' => 'AST',
'hasdst' => false ),
'Asia/Baghdad' => array(
'offset' => 10800000,
'longname' => 'Arabia Standard Time',
'shortname' => 'AST',
'hasdst' => true,
'dstlongname' => 'Arabia Daylight Time',
'dstshortname' => 'ADT' ),
'Asia/Bahrain' => array(
'offset' => 10800000,
'longname' => 'Arabia Standard Time',
'shortname' => 'AST',
'hasdst' => false ),
'Asia/Kuwait' => array(
'offset' => 10800000,
'longname' => 'Arabia Standard Time',
'shortname' => 'AST',
'hasdst' => false ),
'Asia/Qatar' => array(
'offset' => 10800000,
'longname' => 'Arabia Standard Time',
'shortname' => 'AST',
'hasdst' => false ),
'Asia/Riyadh' => array(
'offset' => 10800000,
'longname' => 'Arabia Standard Time',
'shortname' => 'AST',
'hasdst' => false ),
'EAT' => array(
'offset' => 10800000,
'longname' => 'Eastern African Time',
'shortname' => 'EAT',
'hasdst' => false ),
'Etc/GMT-3' => array(
'offset' => 10800000,
'longname' => 'GMT+03:00',
'shortname' => 'GMT+03:00',
'hasdst' => false ),
'Europe/Moscow' => array(
'offset' => 10800000,
'longname' => 'Moscow Standard Time',
'shortname' => 'MSK',
'hasdst' => true,
'dstlongname' => 'Moscow Daylight Time',
'dstshortname' => 'MSD' ),
'Indian/Antananarivo' => array(
'offset' => 10800000,
'longname' => 'Eastern African Time',
'shortname' => 'EAT',
'hasdst' => false ),
'Indian/Comoro' => array(
'offset' => 10800000,
'longname' => 'Eastern African Time',
'shortname' => 'EAT',
'hasdst' => false ),
'Indian/Mayotte' => array(
'offset' => 10800000,
'longname' => 'Eastern African Time',
'shortname' => 'EAT',
'hasdst' => false ),
'W-SU' => array(
'offset' => 10800000,
'longname' => 'Moscow Standard Time',
'shortname' => 'MSK',
'hasdst' => true,
'dstlongname' => 'Moscow Daylight Time',
'dstshortname' => 'MSD' ),
'Asia/Riyadh87' => array(
'offset' => 11224000,
'longname' => 'GMT+03:07',
'shortname' => 'GMT+03:07',
'hasdst' => false ),
'Asia/Riyadh88' => array(
'offset' => 11224000,
'longname' => 'GMT+03:07',
'shortname' => 'GMT+03:07',
'hasdst' => false ),
'Asia/Riyadh89' => array(
'offset' => 11224000,
'longname' => 'GMT+03:07',
'shortname' => 'GMT+03:07',
'hasdst' => false ),
'Mideast/Riyadh87' => array(
'offset' => 11224000,
'longname' => 'GMT+03:07',
'shortname' => 'GMT+03:07',
'hasdst' => false ),
'Mideast/Riyadh88' => array(
'offset' => 11224000,
'longname' => 'GMT+03:07',
'shortname' => 'GMT+03:07',
'hasdst' => false ),
'Mideast/Riyadh89' => array(
'offset' => 11224000,
'longname' => 'GMT+03:07',
'shortname' => 'GMT+03:07',
'hasdst' => false ),
'Asia/Tehran' => array(
'offset' => 12600000,
'longname' => 'Iran Time',
'shortname' => 'IRT',
'hasdst' => true,
'dstlongname' => 'Iran Sumer Time',
'dstshortname' => 'IRST' ),
'Iran' => array(
'offset' => 12600000,
'longname' => 'Iran Time',
'shortname' => 'IRT',
'hasdst' => true,
'dstlongname' => 'Iran Sumer Time',
'dstshortname' => 'IRST' ),
'Asia/Aqtau' => array(
'offset' => 14400000,
'longname' => 'Aqtau Time',
'shortname' => 'AQTT',
'hasdst' => true,
'dstlongname' => 'Aqtau Summer Time',
'dstshortname' => 'AQTST' ),
'Asia/Baku' => array(
'offset' => 14400000,
'longname' => 'Azerbaijan Time',
'shortname' => 'AZT',
'hasdst' => true,
'dstlongname' => 'Azerbaijan Summer Time',
'dstshortname' => 'AZST' ),
'Asia/Dubai' => array(
'offset' => 14400000,
'longname' => 'Gulf Standard Time',
'shortname' => 'GST',
'hasdst' => false ),
'Asia/Muscat' => array(
'offset' => 14400000,
'longname' => 'Gulf Standard Time',
'shortname' => 'GST',
'hasdst' => false ),
'Asia/Tbilisi' => array(
'offset' => 14400000,
'longname' => 'Georgia Time',
'shortname' => 'GET',
'hasdst' => true,
'dstlongname' => 'Georgia Summer Time',
'dstshortname' => 'GEST' ),
'Asia/Yerevan' => array(
'offset' => 14400000,
'longname' => 'Armenia Time',
'shortname' => 'AMT',
'hasdst' => true,
'dstlongname' => 'Armenia Summer Time',
'dstshortname' => 'AMST' ),
'Etc/GMT-4' => array(
'offset' => 14400000,
'longname' => 'GMT+04:00',
'shortname' => 'GMT+04:00',
'hasdst' => false ),
'Europe/Samara' => array(
'offset' => 14400000,
'longname' => 'Samara Time',
'shortname' => 'SAMT',
'hasdst' => true,
'dstlongname' => 'Samara Summer Time',
'dstshortname' => 'SAMST' ),
'Indian/Mahe' => array(
'offset' => 14400000,
'longname' => 'Seychelles Time',
'shortname' => 'SCT',
'hasdst' => false ),
'Indian/Mauritius' => array(
'offset' => 14400000,
'longname' => 'Mauritius Time',
'shortname' => 'MUT',
'hasdst' => false ),
'Indian/Reunion' => array(
'offset' => 14400000,
'longname' => 'Reunion Time',
'shortname' => 'RET',
'hasdst' => false ),
'NET' => array(
'offset' => 14400000,
'longname' => 'Armenia Time',
'shortname' => 'AMT',
'hasdst' => true,
'dstlongname' => 'Armenia Summer Time',
'dstshortname' => 'AMST' ),
'Asia/Kabul' => array(
'offset' => 16200000,
'longname' => 'Afghanistan Time',
'shortname' => 'AFT',
'hasdst' => false ),
'Asia/Aqtobe' => array(
'offset' => 18000000,
'longname' => 'Aqtobe Time',
'shortname' => 'AQTT',
'hasdst' => true,
'dstlongname' => 'Aqtobe Summer Time',
'dstshortname' => 'AQTST' ),
'Asia/Ashgabat' => array(
'offset' => 18000000,
'longname' => 'Turkmenistan Time',
'shortname' => 'TMT',
'hasdst' => false ),
'Asia/Ashkhabad' => array(
'offset' => 18000000,
'longname' => 'Turkmenistan Time',
'shortname' => 'TMT',
'hasdst' => false ),
'Asia/Bishkek' => array(
'offset' => 18000000,
'longname' => 'Kirgizstan Time',
'shortname' => 'KGT',
'hasdst' => true,
'dstlongname' => 'Kirgizstan Summer Time',
'dstshortname' => 'KGST' ),
'Asia/Dushanbe' => array(
'offset' => 18000000,
'longname' => 'Tajikistan Time',
'shortname' => 'TJT',
'hasdst' => false ),
'Asia/Karachi' => array(
'offset' => 18000000,
'longname' => 'Pakistan Time',
'shortname' => 'PKT',
'hasdst' => false ),
'Asia/Samarkand' => array(
'offset' => 18000000,
'longname' => 'Turkmenistan Time',
'shortname' => 'TMT',
'hasdst' => false ),
'Asia/Tashkent' => array(
'offset' => 18000000,
'longname' => 'Uzbekistan Time',
'shortname' => 'UZT',
'hasdst' => false ),
'Asia/Yekaterinburg' => array(
'offset' => 18000000,
'longname' => 'Yekaterinburg Time',
'shortname' => 'YEKT',
'hasdst' => true,
'dstlongname' => 'Yekaterinburg Summer Time',
'dstshortname' => 'YEKST' ),
'Etc/GMT-5' => array(
'offset' => 18000000,
'longname' => 'GMT+05:00',
'shortname' => 'GMT+05:00',
'hasdst' => false ),
'Indian/Kerguelen' => array(
'offset' => 18000000,
'longname' => 'French Southern & Antarctic Lands Time',
'shortname' => 'TFT',
'hasdst' => false ),
'Indian/Maldives' => array(
'offset' => 18000000,
'longname' => 'Maldives Time',
'shortname' => 'MVT',
'hasdst' => false ),
'PLT' => array(
'offset' => 18000000,
'longname' => 'Pakistan Time',
'shortname' => 'PKT',
'hasdst' => false ),
'Asia/Calcutta' => array(
'offset' => 19800000,
'longname' => 'India Standard Time',
'shortname' => 'IST',
'hasdst' => false ),
'IST' => array(
'offset' => 19800000,
'longname' => 'India Standard Time',
'shortname' => 'IST',
'hasdst' => false ),
'Asia/Katmandu' => array(
'offset' => 20700000,
'longname' => 'Nepal Time',
'shortname' => 'NPT',
'hasdst' => false ),
'Antarctica/Mawson' => array(
'offset' => 21600000,
'longname' => 'Mawson Time',
'shortname' => 'MAWT',
'hasdst' => false ),
'Antarctica/Vostok' => array(
'offset' => 21600000,
'longname' => 'Vostok time',
'shortname' => 'VOST',
'hasdst' => false ),
'Asia/Almaty' => array(
'offset' => 21600000,
'longname' => 'Alma-Ata Time',
'shortname' => 'ALMT',
'hasdst' => true,
'dstlongname' => 'Alma-Ata Summer Time',
'dstshortname' => 'ALMST' ),
'Asia/Colombo' => array(
'offset' => 21600000,
'longname' => 'Sri Lanka Time',
'shortname' => 'LKT',
'hasdst' => false ),
'Asia/Dacca' => array(
'offset' => 21600000,
'longname' => 'Bangladesh Time',
'shortname' => 'BDT',
'hasdst' => false ),
'Asia/Dhaka' => array(
'offset' => 21600000,
'longname' => 'Bangladesh Time',
'shortname' => 'BDT',
'hasdst' => false ),
'Asia/Novosibirsk' => array(
'offset' => 21600000,
'longname' => 'Novosibirsk Time',
'shortname' => 'NOVT',
'hasdst' => true,
'dstlongname' => 'Novosibirsk Summer Time',
'dstshortname' => 'NOVST' ),
'Asia/Omsk' => array(
'offset' => 21600000,
'longname' => 'Omsk Time',
'shortname' => 'OMST',
'hasdst' => true,
'dstlongname' => 'Omsk Summer Time',
'dstshortname' => 'OMSST' ),
'Asia/Thimbu' => array(
'offset' => 21600000,
'longname' => 'Bhutan Time',
'shortname' => 'BTT',
'hasdst' => false ),
'Asia/Thimphu' => array(
'offset' => 21600000,
'longname' => 'Bhutan Time',
'shortname' => 'BTT',
'hasdst' => false ),
'BDT' => array(
'offset' => 21600000,
'longname' => 'Bangladesh Time',
'shortname' => 'BDT',
'hasdst' => false ),
'Etc/GMT-6' => array(
'offset' => 21600000,
'longname' => 'GMT+06:00',
'shortname' => 'GMT+06:00',
'hasdst' => false ),
'Indian/Chagos' => array(
'offset' => 21600000,
'longname' => 'Indian Ocean Territory Time',
'shortname' => 'IOT',
'hasdst' => false ),
'Asia/Rangoon' => array(
'offset' => 23400000,
'longname' => 'Myanmar Time',
'shortname' => 'MMT',
'hasdst' => false ),
'Indian/Cocos' => array(
'offset' => 23400000,
'longname' => 'Cocos Islands Time',
'shortname' => 'CCT',
'hasdst' => false ),
'Antarctica/Davis' => array(
'offset' => 25200000,
'longname' => 'Davis Time',
'shortname' => 'DAVT',
'hasdst' => false ),
'Asia/Bangkok' => array(
'offset' => 25200000,
'longname' => 'Indochina Time',
'shortname' => 'ICT',
'hasdst' => false ),
'Asia/Hovd' => array(
'offset' => 25200000,
'longname' => 'Hovd Time',
'shortname' => 'HOVT',
'hasdst' => false ),
'Asia/Jakarta' => array(
'offset' => 25200000,
'longname' => 'West Indonesia Time',
'shortname' => 'WIT',
'hasdst' => false ),
'Asia/Krasnoyarsk' => array(
'offset' => 25200000,
'longname' => 'Krasnoyarsk Time',
'shortname' => 'KRAT',
'hasdst' => true,
'dstlongname' => 'Krasnoyarsk Summer Time',
'dstshortname' => 'KRAST' ),
'Asia/Phnom_Penh' => array(
'offset' => 25200000,
'longname' => 'Indochina Time',
'shortname' => 'ICT',
'hasdst' => false ),
'Asia/Pontianak' => array(
'offset' => 25200000,
'longname' => 'West Indonesia Time',
'shortname' => 'WIT',
'hasdst' => false ),
'Asia/Saigon' => array(
'offset' => 25200000,
'longname' => 'Indochina Time',
'shortname' => 'ICT',
'hasdst' => false ),
'Asia/Vientiane' => array(
'offset' => 25200000,
'longname' => 'Indochina Time',
'shortname' => 'ICT',
'hasdst' => false ),
'Etc/GMT-7' => array(
'offset' => 25200000,
'longname' => 'GMT+07:00',
'shortname' => 'GMT+07:00',
'hasdst' => false ),
'Indian/Christmas' => array(
'offset' => 25200000,
'longname' => 'Christmas Island Time',
'shortname' => 'CXT',
'hasdst' => false ),
'VST' => array(
'offset' => 25200000,
'longname' => 'Indochina Time',
'shortname' => 'ICT',
'hasdst' => false ),
'Antarctica/Casey' => array(
'offset' => 28800000,
'longname' => 'Western Standard Time (Australia)',
'shortname' => 'WST',
'hasdst' => false ),
'Asia/Brunei' => array(
'offset' => 28800000,
'longname' => 'Brunei Time',
'shortname' => 'BNT',
'hasdst' => false ),
'Asia/Chongqing' => array(
'offset' => 28800000,
'longname' => 'China Standard Time',
'shortname' => 'CST',
'hasdst' => false ),
'Asia/Chungking' => array(
'offset' => 28800000,
'longname' => 'China Standard Time',
'shortname' => 'CST',
'hasdst' => false ),
'Asia/Harbin' => array(
'offset' => 28800000,
'longname' => 'China Standard Time',
'shortname' => 'CST',
'hasdst' => false ),
'Asia/Hong_Kong' => array(
'offset' => 28800000,
'longname' => 'Hong Kong Time',
'shortname' => 'HKT',
'hasdst' => false ),
'Asia/Irkutsk' => array(
'offset' => 28800000,
'longname' => 'Irkutsk Time',
'shortname' => 'IRKT',
'hasdst' => true,
'dstlongname' => 'Irkutsk Summer Time',
'dstshortname' => 'IRKST' ),
'Asia/Kashgar' => array(
'offset' => 28800000,
'longname' => 'China Standard Time',
'shortname' => 'CST',
'hasdst' => false ),
'Asia/Kuala_Lumpur' => array(
'offset' => 28800000,
'longname' => 'Malaysia Time',
'shortname' => 'MYT',
'hasdst' => false ),
'Asia/Kuching' => array(
'offset' => 28800000,
'longname' => 'Malaysia Time',
'shortname' => 'MYT',
'hasdst' => false ),
'Asia/Macao' => array(
'offset' => 28800000,
'longname' => 'China Standard Time',
'shortname' => 'CST',
'hasdst' => false ),
'Asia/Manila' => array(
'offset' => 28800000,
'longname' => 'Philippines Time',
'shortname' => 'PHT',
'hasdst' => false ),
'Asia/Shanghai' => array(
'offset' => 28800000,
'longname' => 'China Standard Time',
'shortname' => 'CST',
'hasdst' => false ),
'Asia/Singapore' => array(
'offset' => 28800000,
'longname' => 'Singapore Time',
'shortname' => 'SGT',
'hasdst' => false ),
'Asia/Taipei' => array(
'offset' => 28800000,
'longname' => 'China Standard Time',
'shortname' => 'CST',
'hasdst' => false ),
'Asia/Ujung_Pandang' => array(
'offset' => 28800000,
'longname' => 'Central Indonesia Time',
'shortname' => 'CIT',
'hasdst' => false ),
'Asia/Ulaanbaatar' => array(
'offset' => 28800000,
'longname' => 'Ulaanbaatar Time',
'shortname' => 'ULAT',
'hasdst' => false ),
'Asia/Ulan_Bator' => array(
'offset' => 28800000,
'longname' => 'Ulaanbaatar Time',
'shortname' => 'ULAT',
'hasdst' => false ),
'Asia/Urumqi' => array(
'offset' => 28800000,
'longname' => 'China Standard Time',
'shortname' => 'CST',
'hasdst' => false ),
'Australia/Perth' => array(
'offset' => 28800000,
'longname' => 'Western Standard Time (Australia)',
'shortname' => 'WST',
'hasdst' => false ),
'Australia/West' => array(
'offset' => 28800000,
'longname' => 'Western Standard Time (Australia)',
'shortname' => 'WST',
'hasdst' => false ),
'CTT' => array(
'offset' => 28800000,
'longname' => 'China Standard Time',
'shortname' => 'CST',
'hasdst' => false ),
'Etc/GMT-8' => array(
'offset' => 28800000,
'longname' => 'GMT+08:00',
'shortname' => 'GMT+08:00',
'hasdst' => false ),
'Hongkong' => array(
'offset' => 28800000,
'longname' => 'Hong Kong Time',
'shortname' => 'HKT',
'hasdst' => false ),
'PRC' => array(
'offset' => 28800000,
'longname' => 'China Standard Time',
'shortname' => 'CST',
'hasdst' => false ),
'Singapore' => array(
'offset' => 28800000,
'longname' => 'Singapore Time',
'shortname' => 'SGT',
'hasdst' => false ),
'Asia/Choibalsan' => array(
'offset' => 32400000,
'longname' => 'Choibalsan Time',
'shortname' => 'CHOT',
'hasdst' => false ),
'Asia/Dili' => array(
'offset' => 32400000,
'longname' => 'East Timor Time',
'shortname' => 'TPT',
'hasdst' => false ),
'Asia/Jayapura' => array(
'offset' => 32400000,
'longname' => 'East Indonesia Time',
'shortname' => 'EIT',
'hasdst' => false ),
'Asia/Pyongyang' => array(
'offset' => 32400000,
'longname' => 'Korea Standard Time',
'shortname' => 'KST',
'hasdst' => false ),
'Asia/Seoul' => array(
'offset' => 32400000,
'longname' => 'Korea Standard Time',
'shortname' => 'KST',
'hasdst' => false ),
'Asia/Tokyo' => array(
'offset' => 32400000,
'longname' => 'Japan Standard Time',
'shortname' => 'JST',
'hasdst' => false ),
'Asia/Yakutsk' => array(
'offset' => 32400000,
'longname' => 'Yakutsk Time',
'shortname' => 'YAKT',
'hasdst' => true,
'dstlongname' => 'Yaktsk Summer Time',
'dstshortname' => 'YAKST' ),
'Etc/GMT-9' => array(
'offset' => 32400000,
'longname' => 'GMT+09:00',
'shortname' => 'GMT+09:00',
'hasdst' => false ),
'JST' => array(
'offset' => 32400000,
'longname' => 'Japan Standard Time',
'shortname' => 'JST',
'hasdst' => false ),
'Japan' => array(
'offset' => 32400000,
'longname' => 'Japan Standard Time',
'shortname' => 'JST',
'hasdst' => false ),
'Pacific/Palau' => array(
'offset' => 32400000,
'longname' => 'Palau Time',
'shortname' => 'PWT',
'hasdst' => false ),
'ROK' => array(
'offset' => 32400000,
'longname' => 'Korea Standard Time',
'shortname' => 'KST',
'hasdst' => false ),
'ACT' => array(
'offset' => 34200000,
'longname' => 'Central Standard Time (Northern Territory)',
'shortname' => 'CST',
'hasdst' => false ),
'Australia/Adelaide' => array(
'offset' => 34200000,
'longname' => 'Central Standard Time (South Australia)',
'shortname' => 'CST',
'hasdst' => true,
'dstlongname' => 'Central Summer Time (South Australia)',
'dstshortname' => 'CST' ),
'Australia/Broken_Hill' => array(
'offset' => 34200000,
'longname' => 'Central Standard Time (South Australia/New South Wales)',
'shortname' => 'CST',
'hasdst' => true,
'dstlongname' => 'Central Summer Time (South Australia/New South Wales)',
'dstshortname' => 'CST' ),
'Australia/Darwin' => array(
'offset' => 34200000,
'longname' => 'Central Standard Time (Northern Territory)',
'shortname' => 'CST',
'hasdst' => false ),
'Australia/North' => array(
'offset' => 34200000,
'longname' => 'Central Standard Time (Northern Territory)',
'shortname' => 'CST',
'hasdst' => false ),
'Australia/South' => array(
'offset' => 34200000,
'longname' => 'Central Standard Time (South Australia)',
'shortname' => 'CST',
'hasdst' => true,
'dstlongname' => 'Central Summer Time (South Australia)',
'dstshortname' => 'CST' ),
'Australia/Yancowinna' => array(
'offset' => 34200000,
'longname' => 'Central Standard Time (South Australia/New South Wales)',
'shortname' => 'CST',
'hasdst' => true,
'dstlongname' => 'Central Summer Time (South Australia/New South Wales)',
'dstshortname' => 'CST' ),
'AET' => array(
'offset' => 36000000,
'longname' => 'Eastern Standard Time (New South Wales)',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Summer Time (New South Wales)',
'dstshortname' => 'EST' ),
'Antarctica/DumontDUrville' => array(
'offset' => 36000000,
'longname' => 'Dumont-d\'Urville Time',
'shortname' => 'DDUT',
'hasdst' => false ),
'Asia/Sakhalin' => array(
'offset' => 36000000,
'longname' => 'Sakhalin Time',
'shortname' => 'SAKT',
'hasdst' => true,
'dstlongname' => 'Sakhalin Summer Time',
'dstshortname' => 'SAKST' ),
'Asia/Vladivostok' => array(
'offset' => 36000000,
'longname' => 'Vladivostok Time',
'shortname' => 'VLAT',
'hasdst' => true,
'dstlongname' => 'Vladivostok Summer Time',
'dstshortname' => 'VLAST' ),
'Australia/ACT' => array(
'offset' => 36000000,
'longname' => 'Eastern Standard Time (New South Wales)',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Summer Time (New South Wales)',
'dstshortname' => 'EST' ),
'Australia/Brisbane' => array(
'offset' => 36000000,
'longname' => 'Eastern Standard Time (Queensland)',
'shortname' => 'EST',
'hasdst' => false ),
'Australia/Canberra' => array(
'offset' => 36000000,
'longname' => 'Eastern Standard Time (New South Wales)',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Summer Time (New South Wales)',
'dstshortname' => 'EST' ),
'Australia/Hobart' => array(
'offset' => 36000000,
'longname' => 'Eastern Standard Time (Tasmania)',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Summer Time (Tasmania)',
'dstshortname' => 'EST' ),
'Australia/Lindeman' => array(
'offset' => 36000000,
'longname' => 'Eastern Standard Time (Queensland)',
'shortname' => 'EST',
'hasdst' => false ),
'Australia/Melbourne' => array(
'offset' => 36000000,
'longname' => 'Eastern Standard Time (Victoria)',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Summer Time (Victoria)',
'dstshortname' => 'EST' ),
'Australia/NSW' => array(
'offset' => 36000000,
'longname' => 'Eastern Standard Time (New South Wales)',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Summer Time (New South Wales)',
'dstshortname' => 'EST' ),
'Australia/Queensland' => array(
'offset' => 36000000,
'longname' => 'Eastern Standard Time (Queensland)',
'shortname' => 'EST',
'hasdst' => false ),
'Australia/Sydney' => array(
'offset' => 36000000,
'longname' => 'Eastern Standard Time (New South Wales)',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Summer Time (New South Wales)',
'dstshortname' => 'EST' ),
'Australia/Tasmania' => array(
'offset' => 36000000,
'longname' => 'Eastern Standard Time (Tasmania)',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Summer Time (Tasmania)',
'dstshortname' => 'EST' ),
'Australia/Victoria' => array(
'offset' => 36000000,
'longname' => 'Eastern Standard Time (Victoria)',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Summer Time (Victoria)',
'dstshortname' => 'EST' ),
'Etc/GMT-10' => array(
'offset' => 36000000,
'longname' => 'GMT+10:00',
'shortname' => 'GMT+10:00',
'hasdst' => false ),
'Pacific/Guam' => array(
'offset' => 36000000,
'longname' => 'Chamorro Standard Time',
'shortname' => 'ChST',
'hasdst' => false ),
'Pacific/Port_Moresby' => array(
'offset' => 36000000,
'longname' => 'Papua New Guinea Time',
'shortname' => 'PGT',
'hasdst' => false ),
'Pacific/Saipan' => array(
'offset' => 36000000,
'longname' => 'Chamorro Standard Time',
'shortname' => 'ChST',
'hasdst' => false ),
'Pacific/Truk' => array(
'offset' => 36000000,
'longname' => 'Truk Time',
'shortname' => 'TRUT',
'hasdst' => false ),
'Pacific/Yap' => array(
'offset' => 36000000,
'longname' => 'Yap Time',
'shortname' => 'YAPT',
'hasdst' => false ),
'Australia/LHI' => array(
'offset' => 37800000,
'longname' => 'Load Howe Standard Time',
'shortname' => 'LHST',
'hasdst' => true,
'dstlongname' => 'Load Howe Summer Time',
'dstshortname' => 'LHST' ),
'Australia/Lord_Howe' => array(
'offset' => 37800000,
'longname' => 'Load Howe Standard Time',
'shortname' => 'LHST',
'hasdst' => true,
'dstlongname' => 'Load Howe Summer Time',
'dstshortname' => 'LHST' ),
'Asia/Magadan' => array(
'offset' => 39600000,
'longname' => 'Magadan Time',
'shortname' => 'MAGT',
'hasdst' => true,
'dstlongname' => 'Magadan Summer Time',
'dstshortname' => 'MAGST' ),
'Etc/GMT-11' => array(
'offset' => 39600000,
'longname' => 'GMT+11:00',
'shortname' => 'GMT+11:00',
'hasdst' => false ),
'Pacific/Efate' => array(
'offset' => 39600000,
'longname' => 'Vanuatu Time',
'shortname' => 'VUT',
'hasdst' => false ),
'Pacific/Guadalcanal' => array(
'offset' => 39600000,
'longname' => 'Solomon Is. Time',
'shortname' => 'SBT',
'hasdst' => false ),
'Pacific/Kosrae' => array(
'offset' => 39600000,
'longname' => 'Kosrae Time',
'shortname' => 'KOST',
'hasdst' => false ),
'Pacific/Noumea' => array(
'offset' => 39600000,
'longname' => 'New Caledonia Time',
'shortname' => 'NCT',
'hasdst' => false ),
'Pacific/Ponape' => array(
'offset' => 39600000,
'longname' => 'Ponape Time',
'shortname' => 'PONT',
'hasdst' => false ),
'SST' => array(
'offset' => 39600000,
'longname' => 'Solomon Is. Time',
'shortname' => 'SBT',
'hasdst' => false ),
'Pacific/Norfolk' => array(
'offset' => 41400000,
'longname' => 'Norfolk Time',
'shortname' => 'NFT',
'hasdst' => false ),
'Antarctica/McMurdo' => array(
'offset' => 43200000,
'longname' => 'New Zealand Standard Time',
'shortname' => 'NZST',
'hasdst' => true,
'dstlongname' => 'New Zealand Daylight Time',
'dstshortname' => 'NZDT' ),
'Antarctica/South_Pole' => array(
'offset' => 43200000,
'longname' => 'New Zealand Standard Time',
'shortname' => 'NZST',
'hasdst' => true,
'dstlongname' => 'New Zealand Daylight Time',
'dstshortname' => 'NZDT' ),
'Asia/Anadyr' => array(
'offset' => 43200000,
'longname' => 'Anadyr Time',
'shortname' => 'ANAT',
'hasdst' => true,
'dstlongname' => 'Anadyr Summer Time',
'dstshortname' => 'ANAST' ),
'Asia/Kamchatka' => array(
'offset' => 43200000,
'longname' => 'Petropavlovsk-Kamchatski Time',
'shortname' => 'PETT',
'hasdst' => true,
'dstlongname' => 'Petropavlovsk-Kamchatski Summer Time',
'dstshortname' => 'PETST' ),
'Etc/GMT-12' => array(
'offset' => 43200000,
'longname' => 'GMT+12:00',
'shortname' => 'GMT+12:00',
'hasdst' => false ),
'Kwajalein' => array(
'offset' => 43200000,
'longname' => 'Marshall Islands Time',
'shortname' => 'MHT',
'hasdst' => false ),
'NST' => array(
'offset' => 43200000,
'longname' => 'New Zealand Standard Time',
'shortname' => 'NZST',
'hasdst' => true,
'dstlongname' => 'New Zealand Daylight Time',
'dstshortname' => 'NZDT' ),
'NZ' => array(
'offset' => 43200000,
'longname' => 'New Zealand Standard Time',
'shortname' => 'NZST',
'hasdst' => true,
'dstlongname' => 'New Zealand Daylight Time',
'dstshortname' => 'NZDT' ),
'Pacific/Auckland' => array(
'offset' => 43200000,
'longname' => 'New Zealand Standard Time',
'shortname' => 'NZST',
'hasdst' => true,
'dstlongname' => 'New Zealand Daylight Time',
'dstshortname' => 'NZDT' ),
'Pacific/Fiji' => array(
'offset' => 43200000,
'longname' => 'Fiji Time',
'shortname' => 'FJT',
'hasdst' => false ),
'Pacific/Funafuti' => array(
'offset' => 43200000,
'longname' => 'Tuvalu Time',
'shortname' => 'TVT',
'hasdst' => false ),
'Pacific/Kwajalein' => array(
'offset' => 43200000,
'longname' => 'Marshall Islands Time',
'shortname' => 'MHT',
'hasdst' => false ),
'Pacific/Majuro' => array(
'offset' => 43200000,
'longname' => 'Marshall Islands Time',
'shortname' => 'MHT',
'hasdst' => false ),
'Pacific/Nauru' => array(
'offset' => 43200000,
'longname' => 'Nauru Time',
'shortname' => 'NRT',
'hasdst' => false ),
'Pacific/Tarawa' => array(
'offset' => 43200000,
'longname' => 'Gilbert Is. Time',
'shortname' => 'GILT',
'hasdst' => false ),
'Pacific/Wake' => array(
'offset' => 43200000,
'longname' => 'Wake Time',
'shortname' => 'WAKT',
'hasdst' => false ),
'Pacific/Wallis' => array(
'offset' => 43200000,
'longname' => 'Wallis & Futuna Time',
'shortname' => 'WFT',
'hasdst' => false ),
'NZ-CHAT' => array(
'offset' => 45900000,
'longname' => 'Chatham Standard Time',
'shortname' => 'CHAST',
'hasdst' => true,
'dstlongname' => 'Chatham Daylight Time',
'dstshortname' => 'CHADT' ),
'Pacific/Chatham' => array(
'offset' => 45900000,
'longname' => 'Chatham Standard Time',
'shortname' => 'CHAST',
'hasdst' => true,
'dstlongname' => 'Chatham Daylight Time',
'dstshortname' => 'CHADT' ),
'Etc/GMT-13' => array(
'offset' => 46800000,
'longname' => 'GMT+13:00',
'shortname' => 'GMT+13:00',
'hasdst' => false ),
'Pacific/Enderbury' => array(
'offset' => 46800000,
'longname' => 'Phoenix Is. Time',
'shortname' => 'PHOT',
'hasdst' => false ),
'Pacific/Tongatapu' => array(
'offset' => 46800000,
'longname' => 'Tonga Time',
'shortname' => 'TOT',
'hasdst' => false ),
'Etc/GMT-14' => array(
'offset' => 50400000,
'longname' => 'GMT+14:00',
'shortname' => 'GMT+14:00',
'hasdst' => false ),
'Pacific/Kiritimati' => array(
'offset' => 50400000,
'longname' => 'Line Is. Time',
'shortname' => 'LINT',
'hasdst' => false ),
'GMT-12:00' => array(
'offset' => -43200000,
'longname' => 'GMT-12:00',
'shortname' => 'GMT-12:00',
'hasdst' => false ),
'GMT-11:00' => array(
'offset' => -39600000,
'longname' => 'GMT-11:00',
'shortname' => 'GMT-11:00',
'hasdst' => false ),
'West Samoa Time' => array(
'offset' => -39600000,
'longname' => 'West Samoa Time',
'shortname' => 'WST',
'hasdst' => false ),
'Samoa Standard Time' => array(
'offset' => -39600000,
'longname' => 'Samoa Standard Time',
'shortname' => 'SST',
'hasdst' => false ),
'Niue Time' => array(
'offset' => -39600000,
'longname' => 'Niue Time',
'shortname' => 'NUT',
'hasdst' => false ),
'Hawaii-Aleutian Standard Time' => array(
'offset' => -36000000,
'longname' => 'Hawaii-Aleutian Standard Time',
'shortname' => 'HAST',
'hasdst' => true,
'dstlongname' => 'Hawaii-Aleutian Daylight Time',
'dstshortname' => 'HADT' ),
'GMT-10:00' => array(
'offset' => -36000000,
'longname' => 'GMT-10:00',
'shortname' => 'GMT-10:00',
'hasdst' => false ),
'Hawaii Standard Time' => array(
'offset' => -36000000,
'longname' => 'Hawaii Standard Time',
'shortname' => 'HST',
'hasdst' => false ),
'Tokelau Time' => array(
'offset' => -36000000,
'longname' => 'Tokelau Time',
'shortname' => 'TKT',
'hasdst' => false ),
'Cook Is. Time' => array(
'offset' => -36000000,
'longname' => 'Cook Is. Time',
'shortname' => 'CKT',
'hasdst' => false ),
'Tahiti Time' => array(
'offset' => -36000000,
'longname' => 'Tahiti Time',
'shortname' => 'TAHT',
'hasdst' => false ),
'Marquesas Time' => array(
'offset' => -34200000,
'longname' => 'Marquesas Time',
'shortname' => 'MART',
'hasdst' => false ),
'Alaska Standard Time' => array(
'offset' => -32400000,
'longname' => 'Alaska Standard Time',
'shortname' => 'AKST',
'hasdst' => true,
'dstlongname' => 'Alaska Daylight Time',
'dstshortname' => 'AKDT' ),
'GMT-09:00' => array(
'offset' => -32400000,
'longname' => 'GMT-09:00',
'shortname' => 'GMT-09:00',
'hasdst' => false ),
'Gambier Time' => array(
'offset' => -32400000,
'longname' => 'Gambier Time',
'shortname' => 'GAMT',
'hasdst' => false ),
'Pacific Standard Time' => array(
'offset' => -28800000,
'longname' => 'Pacific Standard Time',
'shortname' => 'PST',
'hasdst' => true,
'dstlongname' => 'Pacific Daylight Time',
'dstshortname' => 'PDT' ),
'GMT-08:00' => array(
'offset' => -28800000,
'longname' => 'GMT-08:00',
'shortname' => 'GMT-08:00',
'hasdst' => false ),
'Pitcairn Standard Time' => array(
'offset' => -28800000,
'longname' => 'Pitcairn Standard Time',
'shortname' => 'PST',
'hasdst' => false ),
'Mountain Standard Time' => array(
'offset' => -25200000,
'longname' => 'Mountain Standard Time',
'shortname' => 'MST',
'hasdst' => true,
'dstlongname' => 'Mountain Daylight Time',
'dstshortname' => 'MDT' ),
'GMT-07:00' => array(
'offset' => -25200000,
'longname' => 'GMT-07:00',
'shortname' => 'GMT-07:00',
'hasdst' => false ),
'Central Standard Time' => array(
'offset' => -18000000,
'longname' => 'Central Standard Time',
'shortname' => 'CST',
'hasdst' => true,
'dstlongname' => 'Central Daylight Time',
'dstshortname' => 'CDT' ),
'Eastern Standard Time' => array(
'offset' => -18000000,
'longname' => 'Eastern Standard Time',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Daylight Time',
'dstshortname' => 'EDT' ),
'Easter Is. Time' => array(
'offset' => -21600000,
'longname' => 'Easter Is. Time',
'shortname' => 'EAST',
'hasdst' => true,
'dstlongname' => 'Easter Is. Summer Time',
'dstshortname' => 'EASST' ),
'GMT-06:00' => array(
'offset' => -21600000,
'longname' => 'GMT-06:00',
'shortname' => 'GMT-06:00',
'hasdst' => false ),
'Galapagos Time' => array(
'offset' => -21600000,
'longname' => 'Galapagos Time',
'shortname' => 'GALT',
'hasdst' => false ),
'Colombia Time' => array(
'offset' => -18000000,
'longname' => 'Colombia Time',
'shortname' => 'COT',
'hasdst' => false ),
'Acre Time' => array(
'offset' => -18000000,
'longname' => 'Acre Time',
'shortname' => 'ACT',
'hasdst' => false ),
'Ecuador Time' => array(
'offset' => -18000000,
'longname' => 'Ecuador Time',
'shortname' => 'ECT',
'hasdst' => false ),
'Peru Time' => array(
'offset' => -18000000,
'longname' => 'Peru Time',
'shortname' => 'PET',
'hasdst' => false ),
'GMT-05:00' => array(
'offset' => -18000000,
'longname' => 'GMT-05:00',
'shortname' => 'GMT-05:00',
'hasdst' => false ),
'Atlantic Standard Time' => array(
'offset' => -14400000,
'longname' => 'Atlantic Standard Time',
'shortname' => 'AST',
'hasdst' => true,
'dstlongname' => 'Atlantic Daylight Time',
'dstshortname' => 'ADT' ),
'Paraguay Time' => array(
'offset' => -14400000,
'longname' => 'Paraguay Time',
'shortname' => 'PYT',
'hasdst' => true,
'dstlongname' => 'Paraguay Summer Time',
'dstshortname' => 'PYST' ),
'Amazon Standard Time' => array(
'offset' => -14400000,
'longname' => 'Amazon Standard Time',
'shortname' => 'AMT',
'hasdst' => false ),
'Venezuela Time' => array(
'offset' => -14400000,
'longname' => 'Venezuela Time',
'shortname' => 'VET',
'hasdst' => false ),
'Guyana Time' => array(
'offset' => -14400000,
'longname' => 'Guyana Time',
'shortname' => 'GYT',
'hasdst' => false ),
'Bolivia Time' => array(
'offset' => -14400000,
'longname' => 'Bolivia Time',
'shortname' => 'BOT',
'hasdst' => false ),
'Chile Time' => array(
'offset' => -14400000,
'longname' => 'Chile Time',
'shortname' => 'CLT',
'hasdst' => true,
'dstlongname' => 'Chile Summer Time',
'dstshortname' => 'CLST' ),
'Falkland Is. Time' => array(
'offset' => -14400000,
'longname' => 'Falkland Is. Time',
'shortname' => 'FKT',
'hasdst' => true,
'dstlongname' => 'Falkland Is. Summer Time',
'dstshortname' => 'FKST' ),
'GMT-04:00' => array(
'offset' => -14400000,
'longname' => 'GMT-04:00',
'shortname' => 'GMT-04:00',
'hasdst' => false ),
'Newfoundland Standard Time' => array(
'offset' => -12600000,
'longname' => 'Newfoundland Standard Time',
'shortname' => 'NST',
'hasdst' => true,
'dstlongname' => 'Newfoundland Daylight Time',
'dstshortname' => 'NDT' ),
'Argentine Time' => array(
'offset' => -10800000,
'longname' => 'Argentine Time',
'shortname' => 'ART',
'hasdst' => false ),
'Brazil Time' => array(
'offset' => -10800000,
'longname' => 'Brazil Time',
'shortname' => 'BRT',
'hasdst' => true,
'dstlongname' => 'Brazil Summer Time',
'dstshortname' => 'BRST' ),
'French Guiana Time' => array(
'offset' => -10800000,
'longname' => 'French Guiana Time',
'shortname' => 'GFT',
'hasdst' => false ),
'Western Greenland Time' => array(
'offset' => -10800000,
'longname' => 'Western Greenland Time',
'shortname' => 'WGT',
'hasdst' => true,
'dstlongname' => 'Western Greenland Summer Time',
'dstshortname' => 'WGST' ),
'Pierre & Miquelon Standard Time' => array(
'offset' => -10800000,
'longname' => 'Pierre & Miquelon Standard Time',
'shortname' => 'PMST',
'hasdst' => true,
'dstlongname' => 'Pierre & Miquelon Daylight Time',
'dstshortname' => 'PMDT' ),
'Uruguay Time' => array(
'offset' => -10800000,
'longname' => 'Uruguay Time',
'shortname' => 'UYT',
'hasdst' => false ),
'Suriname Time' => array(
'offset' => -10800000,
'longname' => 'Suriname Time',
'shortname' => 'SRT',
'hasdst' => false ),
'GMT-03:00' => array(
'offset' => -10800000,
'longname' => 'GMT-03:00',
'shortname' => 'GMT-03:00',
'hasdst' => false ),
'Fernando de Noronha Time' => array(
'offset' => -7200000,
'longname' => 'Fernando de Noronha Time',
'shortname' => 'FNT',
'hasdst' => false ),
'South Georgia Standard Time' => array(
'offset' => -7200000,
'longname' => 'South Georgia Standard Time',
'shortname' => 'GST',
'hasdst' => false ),
'GMT-02:00' => array(
'offset' => -7200000,
'longname' => 'GMT-02:00',
'shortname' => 'GMT-02:00',
'hasdst' => false ),
'Eastern Greenland Time' => array(
'offset' => 3600000,
'longname' => 'Eastern Greenland Time',
'shortname' => 'EGT',
'hasdst' => true,
'dstlongname' => 'Eastern Greenland Summer Time',
'dstshortname' => 'EGST' ),
'Azores Time' => array(
'offset' => -3600000,
'longname' => 'Azores Time',
'shortname' => 'AZOT',
'hasdst' => true,
'dstlongname' => 'Azores Summer Time',
'dstshortname' => 'AZOST' ),
'Cape Verde Time' => array(
'offset' => -3600000,
'longname' => 'Cape Verde Time',
'shortname' => 'CVT',
'hasdst' => false ),
'GMT-01:00' => array(
'offset' => -3600000,
'longname' => 'GMT-01:00',
'shortname' => 'GMT-01:00',
'hasdst' => false ),
'Greenwich Mean Time' => array(
'offset' => 0,
'longname' => 'Greenwich Mean Time',
'shortname' => 'GMT',
'hasdst' => false ),
'Western European Time' => array(
'offset' => 0,
'longname' => 'Western European Time',
'shortname' => 'WET',
'hasdst' => true,
'dstlongname' => 'Western European Summer Time',
'dstshortname' => 'WEST' ),
'GMT+00:00' => array(
'offset' => 0,
'longname' => 'GMT+00:00',
'shortname' => 'GMT+00:00',
'hasdst' => false ),
'Coordinated Universal Time' => array(
'offset' => 0,
'longname' => 'Coordinated Universal Time',
'shortname' => 'UTC',
'hasdst' => false ),
'Central European Time' => array(
'offset' => 3600000,
'longname' => 'Central European Time',
'shortname' => 'CET',
'hasdst' => true,
'dstlongname' => 'Central European Summer Time',
'dstshortname' => 'CEST' ),
'Western African Time' => array(
'offset' => 3600000,
'longname' => 'Western African Time',
'shortname' => 'WAT',
'hasdst' => true,
'dstlongname' => 'Western African Summer Time',
'dstshortname' => 'WAST' ),
'GMT+01:00' => array(
'offset' => 3600000,
'longname' => 'GMT+01:00',
'shortname' => 'GMT+01:00',
'hasdst' => false ),
'Middle Europe Time' => array(
'offset' => 3600000,
'longname' => 'Middle Europe Time',
'shortname' => 'MET',
'hasdst' => true,
'dstlongname' => 'Middle Europe Summer Time',
'dstshortname' => 'MEST' ),
'Eastern European Time' => array(
'offset' => 7200000,
'longname' => 'Eastern European Time',
'shortname' => 'EET',
'hasdst' => true,
'dstlongname' => 'Eastern European Summer Time',
'dstshortname' => 'EEST' ),
'Central African Time' => array(
'offset' => 7200000,
'longname' => 'Central African Time',
'shortname' => 'CAT',
'hasdst' => false ),
'South Africa Standard Time' => array(
'offset' => 7200000,
'longname' => 'South Africa Standard Time',
'shortname' => 'SAST',
'hasdst' => false ),
'Israel Standard Time' => array(
'offset' => 7200000,
'longname' => 'Israel Standard Time',
'shortname' => 'IST',
'hasdst' => true,
'dstlongname' => 'Israel Daylight Time',
'dstshortname' => 'IDT' ),
'GMT+02:00' => array(
'offset' => 7200000,
'longname' => 'GMT+02:00',
'shortname' => 'GMT+02:00',
'hasdst' => false ),
'Eastern African Time' => array(
'offset' => 10800000,
'longname' => 'Eastern African Time',
'shortname' => 'EAT',
'hasdst' => false ),
'Syowa Time' => array(
'offset' => 10800000,
'longname' => 'Syowa Time',
'shortname' => 'SYOT',
'hasdst' => false ),
'Arabia Standard Time' => array(
'offset' => 10800000,
'longname' => 'Arabia Standard Time',
'shortname' => 'AST',
'hasdst' => false ),
'GMT+03:00' => array(
'offset' => 10800000,
'longname' => 'GMT+03:00',
'shortname' => 'GMT+03:00',
'hasdst' => false ),
'Moscow Standard Time' => array(
'offset' => 10800000,
'longname' => 'Moscow Standard Time',
'shortname' => 'MSK',
'hasdst' => true,
'dstlongname' => 'Moscow Daylight Time',
'dstshortname' => 'MSD' ),
'GMT+03:07' => array(
'offset' => 11224000,
'longname' => 'GMT+03:07',
'shortname' => 'GMT+03:07',
'hasdst' => false ),
'Iran Time' => array(
'offset' => 12600000,
'longname' => 'Iran Time',
'shortname' => 'IRT',
'hasdst' => true,
'dstlongname' => 'Iran Sumer Time',
'dstshortname' => 'IRST' ),
'Aqtau Time' => array(
'offset' => 14400000,
'longname' => 'Aqtau Time',
'shortname' => 'AQTT',
'hasdst' => true,
'dstlongname' => 'Aqtau Summer Time',
'dstshortname' => 'AQTST' ),
'Azerbaijan Time' => array(
'offset' => 14400000,
'longname' => 'Azerbaijan Time',
'shortname' => 'AZT',
'hasdst' => true,
'dstlongname' => 'Azerbaijan Summer Time',
'dstshortname' => 'AZST' ),
'Gulf Standard Time' => array(
'offset' => 14400000,
'longname' => 'Gulf Standard Time',
'shortname' => 'GST',
'hasdst' => false ),
'Georgia Time' => array(
'offset' => 14400000,
'longname' => 'Georgia Time',
'shortname' => 'GET',
'hasdst' => true,
'dstlongname' => 'Georgia Summer Time',
'dstshortname' => 'GEST' ),
'Armenia Time' => array(
'offset' => 14400000,
'longname' => 'Armenia Time',
'shortname' => 'AMT',
'hasdst' => true,
'dstlongname' => 'Armenia Summer Time',
'dstshortname' => 'AMST' ),
'GMT+04:00' => array(
'offset' => 14400000,
'longname' => 'GMT+04:00',
'shortname' => 'GMT+04:00',
'hasdst' => false ),
'Samara Time' => array(
'offset' => 14400000,
'longname' => 'Samara Time',
'shortname' => 'SAMT',
'hasdst' => true,
'dstlongname' => 'Samara Summer Time',
'dstshortname' => 'SAMST' ),
'Seychelles Time' => array(
'offset' => 14400000,
'longname' => 'Seychelles Time',
'shortname' => 'SCT',
'hasdst' => false ),
'Mauritius Time' => array(
'offset' => 14400000,
'longname' => 'Mauritius Time',
'shortname' => 'MUT',
'hasdst' => false ),
'Reunion Time' => array(
'offset' => 14400000,
'longname' => 'Reunion Time',
'shortname' => 'RET',
'hasdst' => false ),
'Afghanistan Time' => array(
'offset' => 16200000,
'longname' => 'Afghanistan Time',
'shortname' => 'AFT',
'hasdst' => false ),
'Aqtobe Time' => array(
'offset' => 18000000,
'longname' => 'Aqtobe Time',
'shortname' => 'AQTT',
'hasdst' => true,
'dstlongname' => 'Aqtobe Summer Time',
'dstshortname' => 'AQTST' ),
'Turkmenistan Time' => array(
'offset' => 18000000,
'longname' => 'Turkmenistan Time',
'shortname' => 'TMT',
'hasdst' => false ),
'Kirgizstan Time' => array(
'offset' => 18000000,
'longname' => 'Kirgizstan Time',
'shortname' => 'KGT',
'hasdst' => true,
'dstlongname' => 'Kirgizstan Summer Time',
'dstshortname' => 'KGST' ),
'Tajikistan Time' => array(
'offset' => 18000000,
'longname' => 'Tajikistan Time',
'shortname' => 'TJT',
'hasdst' => false ),
'Pakistan Time' => array(
'offset' => 18000000,
'longname' => 'Pakistan Time',
'shortname' => 'PKT',
'hasdst' => false ),
'Uzbekistan Time' => array(
'offset' => 18000000,
'longname' => 'Uzbekistan Time',
'shortname' => 'UZT',
'hasdst' => false ),
'Yekaterinburg Time' => array(
'offset' => 18000000,
'longname' => 'Yekaterinburg Time',
'shortname' => 'YEKT',
'hasdst' => true,
'dstlongname' => 'Yekaterinburg Summer Time',
'dstshortname' => 'YEKST' ),
'GMT+05:00' => array(
'offset' => 18000000,
'longname' => 'GMT+05:00',
'shortname' => 'GMT+05:00',
'hasdst' => false ),
'French Southern & Antarctic Lands Time' => array(
'offset' => 18000000,
'longname' => 'French Southern & Antarctic Lands Time',
'shortname' => 'TFT',
'hasdst' => false ),
'Maldives Time' => array(
'offset' => 18000000,
'longname' => 'Maldives Time',
'shortname' => 'MVT',
'hasdst' => false ),
'India Standard Time' => array(
'offset' => 19800000,
'longname' => 'India Standard Time',
'shortname' => 'IST',
'hasdst' => false ),
'Nepal Time' => array(
'offset' => 20700000,
'longname' => 'Nepal Time',
'shortname' => 'NPT',
'hasdst' => false ),
'Mawson Time' => array(
'offset' => 21600000,
'longname' => 'Mawson Time',
'shortname' => 'MAWT',
'hasdst' => false ),
'Vostok time' => array(
'offset' => 21600000,
'longname' => 'Vostok time',
'shortname' => 'VOST',
'hasdst' => false ),
'Alma-Ata Time' => array(
'offset' => 21600000,
'longname' => 'Alma-Ata Time',
'shortname' => 'ALMT',
'hasdst' => true,
'dstlongname' => 'Alma-Ata Summer Time',
'dstshortname' => 'ALMST' ),
'Sri Lanka Time' => array(
'offset' => 21600000,
'longname' => 'Sri Lanka Time',
'shortname' => 'LKT',
'hasdst' => false ),
'Bangladesh Time' => array(
'offset' => 21600000,
'longname' => 'Bangladesh Time',
'shortname' => 'BDT',
'hasdst' => false ),
'Novosibirsk Time' => array(
'offset' => 21600000,
'longname' => 'Novosibirsk Time',
'shortname' => 'NOVT',
'hasdst' => true,
'dstlongname' => 'Novosibirsk Summer Time',
'dstshortname' => 'NOVST' ),
'Omsk Time' => array(
'offset' => 21600000,
'longname' => 'Omsk Time',
'shortname' => 'OMST',
'hasdst' => true,
'dstlongname' => 'Omsk Summer Time',
'dstshortname' => 'OMSST' ),
'Bhutan Time' => array(
'offset' => 21600000,
'longname' => 'Bhutan Time',
'shortname' => 'BTT',
'hasdst' => false ),
'GMT+06:00' => array(
'offset' => 21600000,
'longname' => 'GMT+06:00',
'shortname' => 'GMT+06:00',
'hasdst' => false ),
'Indian Ocean Territory Time' => array(
'offset' => 21600000,
'longname' => 'Indian Ocean Territory Time',
'shortname' => 'IOT',
'hasdst' => false ),
'Myanmar Time' => array(
'offset' => 23400000,
'longname' => 'Myanmar Time',
'shortname' => 'MMT',
'hasdst' => false ),
'Cocos Islands Time' => array(
'offset' => 23400000,
'longname' => 'Cocos Islands Time',
'shortname' => 'CCT',
'hasdst' => false ),
'Davis Time' => array(
'offset' => 25200000,
'longname' => 'Davis Time',
'shortname' => 'DAVT',
'hasdst' => false ),
'Indochina Time' => array(
'offset' => 25200000,
'longname' => 'Indochina Time',
'shortname' => 'ICT',
'hasdst' => false ),
'Hovd Time' => array(
'offset' => 25200000,
'longname' => 'Hovd Time',
'shortname' => 'HOVT',
'hasdst' => false ),
'West Indonesia Time' => array(
'offset' => 25200000,
'longname' => 'West Indonesia Time',
'shortname' => 'WIT',
'hasdst' => false ),
'Krasnoyarsk Time' => array(
'offset' => 25200000,
'longname' => 'Krasnoyarsk Time',
'shortname' => 'KRAT',
'hasdst' => true,
'dstlongname' => 'Krasnoyarsk Summer Time',
'dstshortname' => 'KRAST' ),
'GMT+07:00' => array(
'offset' => 25200000,
'longname' => 'GMT+07:00',
'shortname' => 'GMT+07:00',
'hasdst' => false ),
'Christmas Island Time' => array(
'offset' => 25200000,
'longname' => 'Christmas Island Time',
'shortname' => 'CXT',
'hasdst' => false ),
'Western Standard Time (Australia)' => array(
'offset' => 28800000,
'longname' => 'Western Standard Time (Australia)',
'shortname' => 'WST',
'hasdst' => false ),
'Brunei Time' => array(
'offset' => 28800000,
'longname' => 'Brunei Time',
'shortname' => 'BNT',
'hasdst' => false ),
'China Standard Time' => array(
'offset' => 28800000,
'longname' => 'China Standard Time',
'shortname' => 'CST',
'hasdst' => false ),
'Hong Kong Time' => array(
'offset' => 28800000,
'longname' => 'Hong Kong Time',
'shortname' => 'HKT',
'hasdst' => false ),
'Irkutsk Time' => array(
'offset' => 28800000,
'longname' => 'Irkutsk Time',
'shortname' => 'IRKT',
'hasdst' => true,
'dstlongname' => 'Irkutsk Summer Time',
'dstshortname' => 'IRKST' ),
'Malaysia Time' => array(
'offset' => 28800000,
'longname' => 'Malaysia Time',
'shortname' => 'MYT',
'hasdst' => false ),
'Philippines Time' => array(
'offset' => 28800000,
'longname' => 'Philippines Time',
'shortname' => 'PHT',
'hasdst' => false ),
'Singapore Time' => array(
'offset' => 28800000,
'longname' => 'Singapore Time',
'shortname' => 'SGT',
'hasdst' => false ),
'Central Indonesia Time' => array(
'offset' => 28800000,
'longname' => 'Central Indonesia Time',
'shortname' => 'CIT',
'hasdst' => false ),
'Ulaanbaatar Time' => array(
'offset' => 28800000,
'longname' => 'Ulaanbaatar Time',
'shortname' => 'ULAT',
'hasdst' => false ),
'GMT+08:00' => array(
'offset' => 28800000,
'longname' => 'GMT+08:00',
'shortname' => 'GMT+08:00',
'hasdst' => false ),
'Choibalsan Time' => array(
'offset' => 32400000,
'longname' => 'Choibalsan Time',
'shortname' => 'CHOT',
'hasdst' => false ),
'East Timor Time' => array(
'offset' => 32400000,
'longname' => 'East Timor Time',
'shortname' => 'TPT',
'hasdst' => false ),
'East Indonesia Time' => array(
'offset' => 32400000,
'longname' => 'East Indonesia Time',
'shortname' => 'EIT',
'hasdst' => false ),
'Korea Standard Time' => array(
'offset' => 32400000,
'longname' => 'Korea Standard Time',
'shortname' => 'KST',
'hasdst' => false ),
'Japan Standard Time' => array(
'offset' => 32400000,
'longname' => 'Japan Standard Time',
'shortname' => 'JST',
'hasdst' => false ),
'Yakutsk Time' => array(
'offset' => 32400000,
'longname' => 'Yakutsk Time',
'shortname' => 'YAKT',
'hasdst' => true,
'dstlongname' => 'Yaktsk Summer Time',
'dstshortname' => 'YAKST' ),
'GMT+09:00' => array(
'offset' => 32400000,
'longname' => 'GMT+09:00',
'shortname' => 'GMT+09:00',
'hasdst' => false ),
'Palau Time' => array(
'offset' => 32400000,
'longname' => 'Palau Time',
'shortname' => 'PWT',
'hasdst' => false ),
'Central Standard Time (Northern Territory)' => array(
'offset' => 34200000,
'longname' => 'Central Standard Time (Northern Territory)',
'shortname' => 'CST',
'hasdst' => false ),
'Central Standard Time (South Australia)' => array(
'offset' => 34200000,
'longname' => 'Central Standard Time (South Australia)',
'shortname' => 'CST',
'hasdst' => true,
'dstlongname' => 'Central Summer Time (South Australia)',
'dstshortname' => 'CST' ),
'Central Standard Time (South Australia/New South Wales)' => array(
'offset' => 34200000,
'longname' => 'Central Standard Time (South Australia/New South Wales)',
'shortname' => 'CST',
'hasdst' => true,
'dstlongname' => 'Central Summer Time (South Australia/New South Wales)',
'dstshortname' => 'CST' ),
'Eastern Standard Time (New South Wales)' => array(
'offset' => 36000000,
'longname' => 'Eastern Standard Time (New South Wales)',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Summer Time (New South Wales)',
'dstshortname' => 'EST' ),
'Dumont-d\'Urville Time' => array(
'offset' => 36000000,
'longname' => 'Dumont-d\'Urville Time',
'shortname' => 'DDUT',
'hasdst' => false ),
'Sakhalin Time' => array(
'offset' => 36000000,
'longname' => 'Sakhalin Time',
'shortname' => 'SAKT',
'hasdst' => true,
'dstlongname' => 'Sakhalin Summer Time',
'dstshortname' => 'SAKST' ),
'Vladivostok Time' => array(
'offset' => 36000000,
'longname' => 'Vladivostok Time',
'shortname' => 'VLAT',
'hasdst' => true,
'dstlongname' => 'Vladivostok Summer Time',
'dstshortname' => 'VLAST' ),
'Eastern Standard Time (Queensland)' => array(
'offset' => 36000000,
'longname' => 'Eastern Standard Time (Queensland)',
'shortname' => 'EST',
'hasdst' => false ),
'Eastern Standard Time (Tasmania)' => array(
'offset' => 36000000,
'longname' => 'Eastern Standard Time (Tasmania)',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Summer Time (Tasmania)',
'dstshortname' => 'EST' ),
'Eastern Standard Time (Victoria)' => array(
'offset' => 36000000,
'longname' => 'Eastern Standard Time (Victoria)',
'shortname' => 'EST',
'hasdst' => true,
'dstlongname' => 'Eastern Summer Time (Victoria)',
'dstshortname' => 'EST' ),
'GMT+10:00' => array(
'offset' => 36000000,
'longname' => 'GMT+10:00',
'shortname' => 'GMT+10:00',
'hasdst' => false ),
'Chamorro Standard Time' => array(
'offset' => 36000000,
'longname' => 'Chamorro Standard Time',
'shortname' => 'ChST',
'hasdst' => false ),
'Papua New Guinea Time' => array(
'offset' => 36000000,
'longname' => 'Papua New Guinea Time',
'shortname' => 'PGT',
'hasdst' => false ),
'Truk Time' => array(
'offset' => 36000000,
'longname' => 'Truk Time',
'shortname' => 'TRUT',
'hasdst' => false ),
'Yap Time' => array(
'offset' => 36000000,
'longname' => 'Yap Time',
'shortname' => 'YAPT',
'hasdst' => false ),
'Load Howe Standard Time' => array(
'offset' => 37800000,
'longname' => 'Load Howe Standard Time',
'shortname' => 'LHST',
'hasdst' => true,
'dstlongname' => 'Load Howe Summer Time',
'dstshortname' => 'LHST' ),
'Magadan Time' => array(
'offset' => 39600000,
'longname' => 'Magadan Time',
'shortname' => 'MAGT',
'hasdst' => true,
'dstlongname' => 'Magadan Summer Time',
'dstshortname' => 'MAGST' ),
'GMT+11:00' => array(
'offset' => 39600000,
'longname' => 'GMT+11:00',
'shortname' => 'GMT+11:00',
'hasdst' => false ),
'Vanuatu Time' => array(
'offset' => 39600000,
'longname' => 'Vanuatu Time',
'shortname' => 'VUT',
'hasdst' => false ),
'Solomon Is. Time' => array(
'offset' => 39600000,
'longname' => 'Solomon Is. Time',
'shortname' => 'SBT',
'hasdst' => false ),
'Kosrae Time' => array(
'offset' => 39600000,
'longname' => 'Kosrae Time',
'shortname' => 'KOST',
'hasdst' => false ),
'New Caledonia Time' => array(
'offset' => 39600000,
'longname' => 'New Caledonia Time',
'shortname' => 'NCT',
'hasdst' => false ),
'Ponape Time' => array(
'offset' => 39600000,
'longname' => 'Ponape Time',
'shortname' => 'PONT',
'hasdst' => false ),
'Norfolk Time' => array(
'offset' => 41400000,
'longname' => 'Norfolk Time',
'shortname' => 'NFT',
'hasdst' => false ),
'New Zealand Standard Time' => array(
'offset' => 43200000,
'longname' => 'New Zealand Standard Time',
'shortname' => 'NZST',
'hasdst' => true,
'dstlongname' => 'New Zealand Daylight Time',
'dstshortname' => 'NZDT' ),
'Anadyr Time' => array(
'offset' => 43200000,
'longname' => 'Anadyr Time',
'shortname' => 'ANAT',
'hasdst' => true,
'dstlongname' => 'Anadyr Summer Time',
'dstshortname' => 'ANAST' ),
'Petropavlovsk-Kamchatski Time' => array(
'offset' => 43200000,
'longname' => 'Petropavlovsk-Kamchatski Time',
'shortname' => 'PETT',
'hasdst' => true,
'dstlongname' => 'Petropavlovsk-Kamchatski Summer Time',
'dstshortname' => 'PETST' ),
'GMT+12:00' => array(
'offset' => 43200000,
'longname' => 'GMT+12:00',
'shortname' => 'GMT+12:00',
'hasdst' => false ),
'Marshall Islands Time' => array(
'offset' => 43200000,
'longname' => 'Marshall Islands Time',
'shortname' => 'MHT',
'hasdst' => false ),
'Fiji Time' => array(
'offset' => 43200000,
'longname' => 'Fiji Time',
'shortname' => 'FJT',
'hasdst' => false ),
'Tuvalu Time' => array(
'offset' => 43200000,
'longname' => 'Tuvalu Time',
'shortname' => 'TVT',
'hasdst' => false ),
'Nauru Time' => array(
'offset' => 43200000,
'longname' => 'Nauru Time',
'shortname' => 'NRT',
'hasdst' => false ),
'Gilbert Is. Time' => array(
'offset' => 43200000,
'longname' => 'Gilbert Is. Time',
'shortname' => 'GILT',
'hasdst' => false ),
'Wake Time' => array(
'offset' => 43200000,
'longname' => 'Wake Time',
'shortname' => 'WAKT',
'hasdst' => false ),
'Wallis & Futuna Time' => array(
'offset' => 43200000,
'longname' => 'Wallis & Futuna Time',
'shortname' => 'WFT',
'hasdst' => false ),
'Chatham Standard Time' => array(
'offset' => 45900000,
'longname' => 'Chatham Standard Time',
'shortname' => 'CHAST',
'hasdst' => true,
'dstlongname' => 'Chatham Daylight Time',
'dstshortname' => 'CHADT' ),
'GMT+13:00' => array(
'offset' => 46800000,
'longname' => 'GMT+13:00',
'shortname' => 'GMT+13:00',
'hasdst' => false ),
'Phoenix Is. Time' => array(
'offset' => 46800000,
'longname' => 'Phoenix Is. Time',
'shortname' => 'PHOT',
'hasdst' => false ),
'Tonga Time' => array(
'offset' => 46800000,
'longname' => 'Tonga Time',
'shortname' => 'TOT',
'hasdst' => false ),
'GMT+14:00' => array(
'offset' => 50400000,
'longname' => 'GMT+14:00',
'shortname' => 'GMT+14:00',
'hasdst' => false ),
'Line Is. Time' => array(
'offset' => 50400000,
'longname' => 'Line Is. Time',
'shortname' => 'LINT',
'hasdst' => false ),
);
/**
* Initialize default timezone
*
* First try _DATE_TIMEZONE_DEFAULT global, then PHP_TZ environment var,
* then TZ environment var
*/
if(isset($GLOBALS['_DATE_TIMEZONE_DEFAULT'])
&& Date_TimeZone::isValidID($GLOBALS['_DATE_TIMEZONE_DEFAULT']))
{
Date_TimeZone::setDefault($GLOBALS['_DATE_TIMEZONE_DEFAULT']);
} elseif (getenv('PHP_TZ') && Date_TimeZone::isValidID(getenv('PHP_TZ'))) {
Date_TimeZone::setDefault(getenv('PHP_TZ'));
} elseif (getenv('TZ') && Date_TimeZone::isValidID(getenv('TZ'))) {
Date_TimeZone::setDefault(getenv('TZ'));
} elseif (Date_TimeZone::isValidID(date('T'))) {
Date_TimeZone::setDefault(date('T'));
} else {
Date_TimeZone::setDefault('UTC');
}
/*
* Local variables:
* mode: php
* tab-width: 4
* c-basic-offset: 4
* c-hanging-comment-ender-p: nil
* End:
*/
?> Date-1.4.7/docs/LICENSE 100666 0 0 2767 10530726050 7403 Copyright (c) 1997-2006 Baba Buehler, Pierre-Alain Joye
All rights reserved
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. The names of Baba Buehler, Pierre-Alain Joye nor the names of
contributors may not be used to endorse or promote products
derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Date-1.4.7/docs/TODO 100666 0 0 671 10530726050 7036 $Id: TODO,v 1.1 2006/11/21 05:40:20 firman Exp $
TODO
- Fix once the timezone problem
- Once TZ works nicely, update the testunit_date and use
the real timezone and dct to check the expected time offset
- Clean the test cases and atomic display instead of a global ok or failed
- Write the docs....
- More strict complaint againts ISO 8601
- Complaint againts RFC 822 Date and Time Specification
- Complaint againts ISO 3339
Date-1.4.7/tests/bugs/bug-674.phpt 100666 0 0 3156 10530726050 11531
--TEST--
Bug #674: strange (wrong?) result of Date_Calc::endOfWeek
--FILE--
--EXPECT--
Parameters: 17-3-2003
Begin of week = 20030323, End of week = 20030317, Begin of next week = 20030324, Begin of previous week = 20030310
Parameters: 20-3-2003
Begin of week = 20030323, End of week = 20030317, Begin of next week = 20030324, Begin of previous week = 20030310
Parameters: 23-3-2003
Begin of week = 20030323, End of week = 20030317, Begin of next week = 20030324, Begin of previous week = 20030310