<tfoot id='gI2Ct'></tfoot>

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

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

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

      1. php strtotime不工作

        时间:2024-04-13
        <i id='OYJlU'><tr id='OYJlU'><dt id='OYJlU'><q id='OYJlU'><span id='OYJlU'><b id='OYJlU'><form id='OYJlU'><ins id='OYJlU'></ins><ul id='OYJlU'></ul><sub id='OYJlU'></sub></form><legend id='OYJlU'></legend><bdo id='OYJlU'><pre id='OYJlU'><center id='OYJlU'></center></pre></bdo></b><th id='OYJlU'></th></span></q></dt></tr></i><div id='OYJlU'><tfoot id='OYJlU'></tfoot><dl id='OYJlU'><fieldset id='OYJlU'></fieldset></dl></div>
          <tbody id='OYJlU'></tbody>

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

        <legend id='OYJlU'><style id='OYJlU'><dir id='OYJlU'><q id='OYJlU'></q></dir></style></legend>
          <tfoot id='OYJlU'></tfoot>

                  <bdo id='OYJlU'></bdo><ul id='OYJlU'></ul>
                  本文介绍了php strtotime不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  所以我使用 strtotime 将此字符串转换为时间戳:

                  so I converted this string to timestamp using strtotime:

                  strtotime("1 Nov, 2001");
                  

                  导致时间戳为 1320177660

                  which results into the timestamp 1320177660

                  但是当我尝试使用在线时间戳转换器再次将 1320177660 转换为正常的日期格式时,年份最终是 2011 年而不是 2001 年...

                  but then when I tried converted 1320177660 into a normal date format again using an online timestamp converter, the year ended up being 2011 rather than 2001...

                  我做错了什么?

                  推荐答案

                  正如@Evan Mulawski 的评论所说,2001"被解释为时间,而不是年份.去掉逗号让PHP将2001"解释为年份:

                  As @Evan Mulawski's comment says, the "2001" is being interpreted as the time, not the year. Take out the comma to get PHP to interpret the "2001" as a year:

                  <?php
                  $ts = strtotime("1 Nov 2001");
                  echo $ts . "
                  ";
                  $st = strftime("%B %d, %Y, %H:%M:%S", $ts);
                  echo $st . "
                  ";
                  ?>
                  

                  输出:

                  1004590800
                  2001 年 11 月 1 日 00:00:00

                  1004590800
                  November 01, 2001, 00:00:00

                  这篇关于php strtotime不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:PHP strtotime() “二月第一个星期一"如果 2 月 1 日是星期一,则返回第二个星期一 下一篇:从 php 中带有时区标识符的 unix 时间戳返回本地时间

                  相关文章

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

                • <legend id='jcACf'><style id='jcACf'><dir id='jcACf'><q id='jcACf'></q></dir></style></legend>
                    1. <small id='jcACf'></small><noframes id='jcACf'>

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