• <bdo id='BDiNG'></bdo><ul id='BDiNG'></ul>
        <tfoot id='BDiNG'></tfoot>

      1. <i id='BDiNG'><tr id='BDiNG'><dt id='BDiNG'><q id='BDiNG'><span id='BDiNG'><b id='BDiNG'><form id='BDiNG'><ins id='BDiNG'></ins><ul id='BDiNG'></ul><sub id='BDiNG'></sub></form><legend id='BDiNG'></legend><bdo id='BDiNG'><pre id='BDiNG'><center id='BDiNG'></center></pre></bdo></b><th id='BDiNG'></th></span></q></dt></tr></i><div id='BDiNG'><tfoot id='BDiNG'></tfoot><dl id='BDiNG'><fieldset id='BDiNG'></fieldset></dl></div>
      2. <small id='BDiNG'></small><noframes id='BDiNG'>

        <legend id='BDiNG'><style id='BDiNG'><dir id='BDiNG'><q id='BDiNG'></q></dir></style></legend>

        PHP - 从时差中排除所有非营业时间/天

        PHP - Exclude all non-business hours / days from time difference(PHP - 从时差中排除所有非营业时间/天)

          <bdo id='j6gMF'></bdo><ul id='j6gMF'></ul>
        • <small id='j6gMF'></small><noframes id='j6gMF'>

          <tfoot id='j6gMF'></tfoot>
        • <i id='j6gMF'><tr id='j6gMF'><dt id='j6gMF'><q id='j6gMF'><span id='j6gMF'><b id='j6gMF'><form id='j6gMF'><ins id='j6gMF'></ins><ul id='j6gMF'></ul><sub id='j6gMF'></sub></form><legend id='j6gMF'></legend><bdo id='j6gMF'><pre id='j6gMF'><center id='j6gMF'></center></pre></bdo></b><th id='j6gMF'></th></span></q></dt></tr></i><div id='j6gMF'><tfoot id='j6gMF'></tfoot><dl id='j6gMF'><fieldset id='j6gMF'></fieldset></dl></div>

                  <tbody id='j6gMF'></tbody>
              1. <legend id='j6gMF'><style id='j6gMF'><dir id='j6gMF'><q id='j6gMF'></q></dir></style></legend>

                • 本文介绍了PHP - 从时差中排除所有非营业时间/天的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一张表格,显示了自提出工作以来的时间.

                  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.

                  1. 您取开始日期并计算这一天的休息时间(如果是工作日)
                  2. 您选择结束日期并计算这一天的时间,然后
                  3. 您将两者之间的天数乘以您的营业时间(只是那些,即营业日)

                  那你就完成了.

                  找到一个附加的小类,它可以做这些事情.注意没有错误处理、时区设置、夏令时……

                  Find a little class attached, which does those things. Be aware that there is no error handling, time zone settings, daylight saving time, ...

                  输入:

                  • 开始日期
                  • 结束日期

                  输出:

                  • 以秒为单位的时间差

                  可调常数:

                  • 营业时间
                  • 非工作日

                  这篇关于PHP - 从时差中排除所有非营业时间/天的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Converting string to MySQL timestamp format in php(在php中将字符串转换为MySQL时间戳格式)
                  datetime to timestamp(日期时间到时间戳)
                  PHP timestamp date to user timezone(PHP时间戳日期到用户时区)
                  Converting TIMESTAMP to unix time in PHP?(在 PHP 中将 TIMESTAMP 转换为 unix 时间?)
                  Convert ISO 8601 to unixtimestamp(将 ISO 8601 转换为 unixtimestamp)
                  Finding days between 2 unix timestamps in php(在php中查找2个unix时间戳之间的天数)

                        <i id='4mMHi'><tr id='4mMHi'><dt id='4mMHi'><q id='4mMHi'><span id='4mMHi'><b id='4mMHi'><form id='4mMHi'><ins id='4mMHi'></ins><ul id='4mMHi'></ul><sub id='4mMHi'></sub></form><legend id='4mMHi'></legend><bdo id='4mMHi'><pre id='4mMHi'><center id='4mMHi'></center></pre></bdo></b><th id='4mMHi'></th></span></q></dt></tr></i><div id='4mMHi'><tfoot id='4mMHi'></tfoot><dl id='4mMHi'><fieldset id='4mMHi'></fieldset></dl></div>

                            <bdo id='4mMHi'></bdo><ul id='4mMHi'></ul>
                          • <tfoot id='4mMHi'></tfoot>
                              <tbody id='4mMHi'></tbody>
                          • <small id='4mMHi'></small><noframes id='4mMHi'>

                            <legend id='4mMHi'><style id='4mMHi'><dir id='4mMHi'><q id='4mMHi'></q></dir></style></legend>