转换生成 jQuery fullcalendar 的日期时,时区在 Windows 中出现问题。
这是我发布的值,用于识别我在start
中将(IST)
变量作为字符串的错误,并且结尾是从 jQuery fullcalendar <获取响应的值/ strong>如你所见,时区在(India Standard Time)
。请参考控制台图片
在php中使用strtotime()
转换起始和结束变量后,我得到的是
以下是我用于转换的代码:
$dat = array(
'eve_start' => date('Y-m-d', strtotime($_POST['start'])),
'eve_end' => date('Y-m-d', strtotime($_POST['end'])),
'eve_allDay' => 0
);
由于eve_end
(India Standard Time)
无法正常使用
答案 0 :(得分:0)
试试这个,
$start = substr($_POST['start'], 0, strpos($_POST['start'], '('));
$end = substr($_POST['end'], 0, strpos($_POST['end'], '('));
$start_date = date('Y-m-d h:i:s', strtotime($start));
$end_date = date('Y-m-d h:i:s', strtotime($end));
$dat = array(
'eve_start' => $start_date,
'eve_end' => $end_date,
'eve_allDay' => 0
);