我如何获得分钟数? [英] How I Can Get Number Of Minute ?
本文介绍了我如何获得分钟数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
从MySQL数据库中的表中计算两个日期之间的分钟数
我的事件table(..,date_creation,hour_creation,date_closing,hour_closing,)我想知道创建和关闭日期之间的分钟数,也考虑到小时帐户。
我需要一个mysql函数或一个PHP脚本来执行此操作吗?
提前谢谢
Hello everyone,
it is to calculate the number of minutes between two dates from a table in a MySQL database
my incident table (.., date_creation, hour_creation, date_closing, hour_closing,) I want to know the number of minutes between the date of creating and closing , taking into hours account also.
I need a mysql function OR a PHP script to do this?
thank you in advance
推荐答案
这可能就是你想要的:
http:// dev .mysql.com / doc / refman / 5.1 / en / date-and-time-functions.html#function_datediff [ ^ ]
This might be what you want:
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_datediff[^]
我建议你看看
TIMEDIFF [ ^ ]功能。
PHP方式:你需要使用mktime函数:
示例如下:
I would suggest you to look at
TIMEDIFF[^] function.
PHP way: you need to use mktime functions:
example would be:
<?php
time1 = 2014-04-15 10:10:12;
time1="2014-04-15 10:10:12";
这篇关于我如何获得分钟数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文