我有一张表格,显示了自提出工作以来的时间.
I have a table which shows the time since a job was raised.
// These are unix epoch times...
$raised = 1360947684;
$now = 1361192598;
$difference = 244914;
$difference
需要排除工作时间以外的任何时间(例如,9-5 和周末).
$difference
needs to exclude any time outside of business hours (ex, 9-5 and weekends).
我该如何解决这个问题?
How could I tackle this?
你要做的就是3个数字.
The thing you have to do are 3 in numbers.
那你就完成了.
找到一个附加的小类,它可以做这些事情.注意没有错误处理、时区设置、夏令时……
Find a little class attached, which does those things. Be aware that there is no error handling, time zone settings, daylight saving time, ...
输入:
输出:
可调常数:
这篇关于PHP - 从时差中排除所有非营业时间/天的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!