【发布时间】:2023-03-31 08:39:01
【问题描述】:
我有一个项目,我有一个已转换为 strtotime 的特定服务的持续时间,而且我有一个已转换为 strtotime 的日期时间选择器,所以在我的数据库中,我正在使用来自https://github.com/almasaeed2010/AdminLTE 的日历,
现在,这是我的问题,在日历示例中有代码
{
title: 'Long Event',
start: new Date(y, m, d - 5),
end: new Date(y, m, d - 2),
backgroundColor: "#f39c12", //yellow
borderColor: "#f39c12" //yellow
},
我想要完成的是,从服务持续时间来看,假设持续时间是 2 小时转换为 strtotime,我怎样才能将它添加到日期时间的时间戳中?这是我的代码和下面的截图,如你所见,结果非常错误,因为我的约会结束只有 2 小时,但约会显示了几天,
events:
[
<?php $event_query = mysql_query("select * from appointment,service,user where appointment.user_id = user.user_id and service.service_id = appointment.service_id")or die(mysql_error());
while($event_row = mysql_fetch_array($event_query)){
$e = $event_row['appoint_date'];
$ee = $event_row['appoint_end'];
$eee = $e + $ee;
?>
{
title : '<?php echo $event_row['firstname'].' '.$event_row['lastname']; ?> ',
start : '<?php echo $event_row['appoint_date']; ?>',
end: '<?php echo $eee; ?>',
allDay: false,
backgroundColor: "#3c8dbc", //Primary (light-blue)
borderColor: "#3c8dbc" //Primary (light-blue)
},
<?php } ?>
],
开始日期没问题,就结束了,因为我从服务时间戳到日期时间时间戳只加了2个小时,怎么办?
【问题讨论】:
标签: javascript php datetime twitter-bootstrap-3 timestamp