__t); } static function delta($d, $t) { return Date::fromTime($d->getTime() + $t); } static $DAYS_OF_MONTH; static function getMonthDays($d) { $month = $d->getMonth(); $year = $d->getFullYear(); if($month !== 1) { return DateTools::$DAYS_OF_MONTH[$month]; } $isB = _hx_mod($year, 4) === 0 && _hx_mod($year, 100) !== 0 || _hx_mod($year, 400) === 0; return (($isB) ? 29 : 28); } static function seconds($n) { return $n * 1000.0; } static function minutes($n) { return $n * 60.0 * 1000.0; } static function hours($n) { return $n * 60.0 * 60.0 * 1000.0; } static function days($n) { return $n * 24.0 * 60.0 * 60.0 * 1000.0; } static function parse($t) { $s = $t / 1000; $m = $s / 60; $h = $m / 60; return _hx_anonymous(array("ms" => _hx_mod($t, 1000), "seconds" => intval(_hx_mod($s, 60)), "minutes" => intval(_hx_mod($m, 60)), "hours" => intval(_hx_mod($h, 24)), "days" => intval($h / 24))); } static function make($o) { return $o->ms + 1000.0 * ($o->seconds + 60.0 * ($o->minutes + 60.0 * ($o->hours + 24.0 * $o->days))); } function __toString() { return 'DateTools'; } } DateTools::$DAYS_OF_MONTH = new _hx_array(array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31));