在我的数据库中,当我插入使用strtotime转换为时间戳的日期和时间时,它就像“1444600800”,我也有一段时间为某个服务转换为相同的过程,“1443740700”,现在我使用https://github.com/almasaeed2010/AdminLTE,以其http://fullcalendar.io/,在日历事件,它被编写这样一个事件:如何在Unix时间戳中提取月份,日期,年份,小时?
events: [
{
title: 'All Day Event',
start: new Date(y, m, 1),
end: new Date(y, m, d, 13, 30),
backgroundColor: "#f56954", //red
borderColor: "#f56954" //red
} ]
我编写它像这样,但没有成功:
events:
[
<?php $event_query = mysql_query("select *,TIME_FORMAT (`appoint_date`, '%H:%i') from appointment INNER JOIN 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)){
?>
{
title : '<?php echo $event_row['firstname']; ?> ',
start : <?php echo $event_row['appoint_date']; ?>,
end : <?php echo $event_row['duration']; ?>,
allDay: false,
backgroundColor: "#3c8dbc", //Primary (light-blue)
borderColor: "#3c8dbc" //Primary (light-blue)
},
<?php } ?>
]
我想提取时间戳中的日期,月份,小时,我可以添加我的timesta的小时值从服务持续时间到日期和时间时间戳,并将其编码为样本。用公式:
该怎么办?
嘿,是的,我想你可以像这样添加三个零... :-) –
如何提取持续时间并将其添加到时间戳?所以我可以将其结果插入到最后:? –