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

    <small id='cdw3O'></small><noframes id='cdw3O'>

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

      1. <tfoot id='cdw3O'></tfoot>

        PHP strtotime() “二月第一个星期一"如果 2 月 1 日是星期一,则返回第二个星期一

        PHP strtotime() quot;first monday februaryquot; returns second monday if february 1st is a monday(PHP strtotime() “二月第一个星期一如果 2 月 1 日是星期一,则返回第二个星期一)
          <legend id='BoGTj'><style id='BoGTj'><dir id='BoGTj'><q id='BoGTj'></q></dir></style></legend>
          <i id='BoGTj'><tr id='BoGTj'><dt id='BoGTj'><q id='BoGTj'><span id='BoGTj'><b id='BoGTj'><form id='BoGTj'><ins id='BoGTj'></ins><ul id='BoGTj'></ul><sub id='BoGTj'></sub></form><legend id='BoGTj'></legend><bdo id='BoGTj'><pre id='BoGTj'><center id='BoGTj'></center></pre></bdo></b><th id='BoGTj'></th></span></q></dt></tr></i><div id='BoGTj'><tfoot id='BoGTj'></tfoot><dl id='BoGTj'><fieldset id='BoGTj'></fieldset></dl></div>
        1. <small id='BoGTj'></small><noframes id='BoGTj'>

            • <tfoot id='BoGTj'></tfoot>

                <tbody id='BoGTj'></tbody>

                <bdo id='BoGTj'></bdo><ul id='BoGTj'></ul>
                  本文介绍了PHP strtotime() “二月第一个星期一"如果 2 月 1 日是星期一,则返回第二个星期一的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在开发一个计算假期的 PHP 函数:

                  I'm working on a PHP function which calculates holidays:

                  function holidays($country = 1, $timespan_start = 0, $timespan_end = 0)
                  

                  假期以数组中的时间戳形式返回.

                  The holidays are returned as timestamps in an array.

                  因为我必须计算像二月的第一个星期一这样的日期,所以我尝试了 strtotime("first monday february $year"),我发现这对于 2010 年不起作用,因为 02/01/2010 是星期一 - 我改为 2 月 8 日.

                  Since I have to calculate dates like the first Monday of February, I tried strtotime("first monday february $year") and I've discovered that this does not work for 2010, since 02/01/2010 is a Monday - I get February 8th instead.

                  这个bug其实是在变更日志中提到的:在 5.2.7 之前的 PHP 5 中,如果该工作日是该月的第一天,则请求在一个月内出现给定的工作日会错误地将一周添加到返回的时间戳.这已在 5.2.7 及更高版本中得到纠正.

                  This bug is actually mentioned in the change log: In PHP 5 prior to 5.2.7, requesting a given occurrence of a given weekday in a month where that weekday was the first day of the month would incorrectly add one week to the returned timestamp. This has been corrected in 5.2.7 and later versions.

                  但我使用的是 PHP 5.3.8.为什么我会遇到此错误?

                  But I'm using PHP 5.3.8. Why am I experiencing this error?

                  推荐答案

                  看起来你只是少了一个of":

                  Looks like you are just missing an "of":

                  echo date('Y-m-d', strtotime('first monday of february 2010'));
                  

                  将给出预期结果.有关各种输入格式,请参阅 PHP 相对日期手册.

                  will give the expected result. See the PHP Manual on Relative dates for the various input formats.

                  这篇关于PHP strtotime() “二月第一个星期一"如果 2 月 1 日是星期一,则返回第二个星期一的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

                        <bdo id='d7vlb'></bdo><ul id='d7vlb'></ul>
                        • <legend id='d7vlb'><style id='d7vlb'><dir id='d7vlb'><q id='d7vlb'></q></dir></style></legend>

                          <small id='d7vlb'></small><noframes id='d7vlb'>

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