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

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

      2. <legend id='Kzx93'><style id='Kzx93'><dir id='Kzx93'><q id='Kzx93'></q></dir></style></legend>

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

      3. PHP - strtotime,指定时区

        PHP - strtotime, specify timezone(PHP - strtotime,指定时区)
          <tfoot id='6FKIR'></tfoot>
          <legend id='6FKIR'><style id='6FKIR'><dir id='6FKIR'><q id='6FKIR'></q></dir></style></legend>

              <bdo id='6FKIR'></bdo><ul id='6FKIR'></ul>

                    <tbody id='6FKIR'></tbody>

                  <small id='6FKIR'></small><noframes id='6FKIR'>

                1. <i id='6FKIR'><tr id='6FKIR'><dt id='6FKIR'><q id='6FKIR'><span id='6FKIR'><b id='6FKIR'><form id='6FKIR'><ins id='6FKIR'></ins><ul id='6FKIR'></ul><sub id='6FKIR'></sub></form><legend id='6FKIR'></legend><bdo id='6FKIR'><pre id='6FKIR'><center id='6FKIR'></center></pre></bdo></b><th id='6FKIR'></th></span></q></dt></tr></i><div id='6FKIR'><tfoot id='6FKIR'></tfoot><dl id='6FKIR'><fieldset id='6FKIR'></fieldset></dl></div>
                2. 本文介绍了PHP - strtotime,指定时区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个日期字符串,比如2008-09-11".我想从中获得一个时间戳,但我需要动态指定一个时区(而不是 PHP 默认).

                  I have a date string, say '2008-09-11'. I want to get a timestamp out of this, but I need to specify a timezone dynamically (rather then PHP default).

                  回顾一下,我有两个字符串:

                  So to recap, I have two strings:

                  $dateStr = '2008-09-11';
                  $timezone = 'Americas/New_York';
                  

                  我如何获得这个时间戳?

                  How do I get the timestamp for this?

                  一天中的时间将是当天的午夜.... $dateStr = '2008-09-11 00:00:00';

                  The time of day will be the midnight of that day.... $dateStr = '2008-09-11 00:00:00';

                  推荐答案

                  $date = new DateTime($dateStr, new DateTimeZone($timezone));
                  

                  $timestamp = $date->format('U');

                  这篇关于PHP - strtotime,指定时区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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 的问题)
                  • <small id='OFdxh'></small><noframes id='OFdxh'>

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

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

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