• <tfoot id='k6mxN'></tfoot>
    <legend id='k6mxN'><style id='k6mxN'><dir id='k6mxN'><q id='k6mxN'></q></dir></style></legend>

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

      • <bdo id='k6mxN'></bdo><ul id='k6mxN'></ul>
    1. <i id='k6mxN'><tr id='k6mxN'><dt id='k6mxN'><q id='k6mxN'><span id='k6mxN'><b id='k6mxN'><form id='k6mxN'><ins id='k6mxN'></ins><ul id='k6mxN'></ul><sub id='k6mxN'></sub></form><legend id='k6mxN'></legend><bdo id='k6mxN'><pre id='k6mxN'><center id='k6mxN'></center></pre></bdo></b><th id='k6mxN'></th></span></q></dt></tr></i><div id='k6mxN'><tfoot id='k6mxN'></tfoot><dl id='k6mxN'><fieldset id='k6mxN'></fieldset></dl></div>
      1. 日期时间到时间戳

        datetime to timestamp(日期时间到时间戳)

        <tfoot id='vLaLY'></tfoot>

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

                <bdo id='vLaLY'></bdo><ul id='vLaLY'></ul>
                  <legend id='vLaLY'><style id='vLaLY'><dir id='vLaLY'><q id='vLaLY'></q></dir></style></legend>
                  本文介绍了日期时间到时间戳的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  可能的重复:
                  反日期函数?- 不是strtotime
                  是否有可能从这样的日期 2011-02-27 02:04:46 获取 UNIX 时间?

                  你好,

                  我们有这个函数可以将时间戳转换为日期时间:

                  we have this function to convert a timestamp to datetime:

                  $datetime = date('Y-m-d H:i:s', $timestamp);
                  

                  是否有相反的功能?

                  日期时间到时间戳.

                  谢谢

                  推荐答案

                  $timestamp = strtotime($datetime);
                  

                  或者,如果您对格式有信心,请使用 explode() 甚至 substr 拆分字符串,并将必要的部分传递到 mktime 函数.

                  Or if you're confident of the format, split up the string with explode() or even substr and pass the necessary parts into the mktime function.

                  请注意,strtotime 有时会导致时间戳错误,如果使用稍微不合常规的格式.

                  Be aware that strtotime can sometimes get the timestamp wrong, if a slightly unconventional format is used.

                  如果你知道你的输入格式,一个真正准确的方法是使用 DateTime::createFromFormat 例如:

                  A really accurate way of doing this is if you know your input format, is to use DateTime::createFromFormat eg:

                  $dateTimeObject = DateTime::createFromFormat('G:i', '9:30');
                  $dateTimeObject->format('H:i');
                  

                  请参阅 http://php.net/manual/en/function.date.php 了解格式指南,以及 http://php.net/manual/en/datetime.createfromformat.php有关上述方法的信息.

                  See http://php.net/manual/en/function.date.php for formatting guides, and http://php.net/manual/en/datetime.createfromformat.php for info on the method described above.

                  这篇关于日期时间到时间戳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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 的问题)
                  <i id='twwMI'><tr id='twwMI'><dt id='twwMI'><q id='twwMI'><span id='twwMI'><b id='twwMI'><form id='twwMI'><ins id='twwMI'></ins><ul id='twwMI'></ul><sub id='twwMI'></sub></form><legend id='twwMI'></legend><bdo id='twwMI'><pre id='twwMI'><center id='twwMI'></center></pre></bdo></b><th id='twwMI'></th></span></q></dt></tr></i><div id='twwMI'><tfoot id='twwMI'></tfoot><dl id='twwMI'><fieldset id='twwMI'></fieldset></dl></div>
                1. <tfoot id='twwMI'></tfoot>

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

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

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

                          <tbody id='twwMI'></tbody>