mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
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:
parent
36ae60d0e7
commit
7232325624
1 changed files with 18 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Loading…
Add table
Reference in a new issue