300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > php当前时间减去20分钟 从当前日期和时间中减去一些日期和时间 以便在PHP中查找年龄...

php当前时间减去20分钟 从当前日期和时间中减去一些日期和时间 以便在PHP中查找年龄...

时间:2022-08-25 01:13:01

相关推荐

php当前时间减去20分钟 从当前日期和时间中减去一些日期和时间 以便在PHP中查找年龄...

假设我有一张票$create_time =“-08-02 12:35:04”.我想从当前日期和时间中减去$create_time,如$current_time =“-08-02 16:16:02”,以3小时41分钟的格式查找年龄.

$sql = "SELECT count(*) as total, create_time FROM article where ticket_id='$ticket_id'";

$otrs_db = $this->load->database('otrs',true);

$result = $otrs_db->query($sql);

foreach($result->result() as $row)

{?>

<?php echo $row->total ;?> Article(s)

Age: <?php echo date("Y-m-d H:i", strtotime("-$row->create_time",strtotime($thestime))) ?>Created: <?php echo $row->create_time; ?>

}

?>

我知道我的日期减法代码是错误的.我该怎么办?

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。