这是我的转换:
function add_date($givendate,$hr=2)
{
$cd = strtotime($givendate);
$newdate = date('Y-m-d H:i:s', mktime(date('h',$cd)+$hr, date('i',$cd), date('s',$cd), date('m',$cd), date('d',$cd), date('Y',$cd)));
return $newdate;
}
答案 0 :(得分:0)
http://www.symfony-project.org/reference/1_4/en/04-Settings#chapter_04_sub_default_timezone
默认时区位于设置
答案 1 :(得分:0)
您必须在settings.yml
中设置默认用户文化:
default_culture: af # or maybe af-ZA
default_timezone: Africa/Johannesburg
在此设置在您的会话中生效之前,您可能需要重新启动会话(清除Cookie)。
答案 2 :(得分:-1)
12小时格式
return date("g:i a", strtotime("13:30:30"))
返回下午1:30
24小时格式
return date("H:i:s", strtotime("1:30 pm"))
返回13:30:00