Added TimeHelper::gmt()

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3354 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2006-08-03 18:50:06 +00:00
parent 36ae60d0e7
commit 7232325624

View file

@ -409,6 +409,24 @@ class TimeHelper extends Helper {
return $this->output($ret, $return);
}
function gmt($string = null){
if ($string != null) {
$string = $this->fromString($string);
} else {
$string = time();
}
$string = $this->fromString($string);
$hour = intval(date("G", $string));
$minute = intval(date("i", $string));
$second = intval(date("s", $string));
$month = intval(date("n", $string));
$day = intval(date("j", $string));
$year = intval(date("Y", $string));
$return = gmmktime($hour, $minute, $second, $month, $day, $year);
return $return;
}
}
?>