我在 JS 中有一个 datetime 变量,它是:
var date_start = dateFormat(newJobForm.time_start, "yyyy-mm-dd-HH-MM");
var date_end = dateFormat(newJobForm.time_end, "yyyy-mm-dd-HH-MM");
主要问题是:我不能只显示分钟
当我将日期传递给 PHP 的date()
函数时,由于 and 之间的关系:
,它不会保存它。我试过了,但没有用。H
i
explode()
-
URL 是:my_controller/abcd^5^2012-10-15-15-15^2012-10-18-17-30
并且我在 CakePHP 动作中从 JS 获取时间的控制器是:
$time_start = $explode_item[2];
$time_end = $explode_item[3];
$dateStart = strtotime ( date('Y-m-d H:i', $time_start) ) ;
$dateStartArray['Y'] = date ( 'Y' , $dateStart );
$dateStartArray['m'] = date ( 'm' , $dateStart );
$dateStartArray['d'] = date ( 'd' , $dateStart );
$dateStartArray['H'] = date ( 'H' , $dateStart );
$dateStartArray['i'] = date ( 'i' , $dateStart );