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

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

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

    • <bdo id='whDRR'></bdo><ul id='whDRR'></ul>

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

    1. 将此字符串转换为时间戳 PHP

      Convert this string to timestamp PHP(将此字符串转换为时间戳 PHP)
          <tbody id='E7GY0'></tbody>

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

        <legend id='E7GY0'><style id='E7GY0'><dir id='E7GY0'><q id='E7GY0'></q></dir></style></legend>
        1. <i id='E7GY0'><tr id='E7GY0'><dt id='E7GY0'><q id='E7GY0'><span id='E7GY0'><b id='E7GY0'><form id='E7GY0'><ins id='E7GY0'></ins><ul id='E7GY0'></ul><sub id='E7GY0'></sub></form><legend id='E7GY0'></legend><bdo id='E7GY0'><pre id='E7GY0'><center id='E7GY0'></center></pre></bdo></b><th id='E7GY0'></th></span></q></dt></tr></i><div id='E7GY0'><tfoot id='E7GY0'></tfoot><dl id='E7GY0'><fieldset id='E7GY0'></fieldset></dl></div>
            <bdo id='E7GY0'></bdo><ul id='E7GY0'></ul>
              <tfoot id='E7GY0'></tfoot>
              • 本文介绍了将此字符串转换为时间戳 PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我有这个字符串:13/10 15:00",我想将它转换为时间戳,但是当我这样做时:

                I have this string: "13/10 15:00" and I would like to convert it to timestamp but when I do this:

                      $timestamp = strtotime("13/10 15:00");
                

                它返回一个空值.

                推荐答案

                在您的代码中 strtotime() 正在尝试将 13/10 转换为第 10 天第 13 个月,返回错误.

                In your code strtotime() is attempting to convert 13/10 as the tenth day of the 13th month, which returns an error.

                如果要解析自定义格式的日期字符串,最好使用 DateTime::createFromFormat() 代替:

                If you want to parse a date string with a custom format, it's better to use DateTime::createFromFormat() instead:

                $dtime = DateTime::createFromFormat("d/m G:i", "13/10 15:00");
                $timestamp = $dtime->getTimestamp();
                

                这篇关于将此字符串转换为时间戳 PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                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='XLyYG'></bdo><ul id='XLyYG'></ul>

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

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

                          <tfoot id='XLyYG'></tfoot>
                            <tbody id='XLyYG'></tbody>