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

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

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

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

      1. 如何从 MySQL 中的日期时间中减去小时数?

        How to subtract hours from a datetime in MySQL?(如何从 MySQL 中的日期时间中减去小时数?)
        <legend id='efhWc'><style id='efhWc'><dir id='efhWc'><q id='efhWc'></q></dir></style></legend>

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

                  <tbody id='efhWc'></tbody>
                  <bdo id='efhWc'></bdo><ul id='efhWc'></ul>
                  <tfoot id='efhWc'></tfoot>
                  <i id='efhWc'><tr id='efhWc'><dt id='efhWc'><q id='efhWc'><span id='efhWc'><b id='efhWc'><form id='efhWc'><ins id='efhWc'></ins><ul id='efhWc'></ul><sub id='efhWc'></sub></form><legend id='efhWc'></legend><bdo id='efhWc'><pre id='efhWc'><center id='efhWc'></center></pre></bdo></b><th id='efhWc'></th></span></q></dt></tr></i><div id='efhWc'><tfoot id='efhWc'></tfoot><dl id='efhWc'><fieldset id='efhWc'></fieldset></dl></div>
                  本文介绍了如何从 MySQL 中的日期时间中减去小时数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我得到一个日期时间字段,它当前在查询中为:

                  I get a datetime field, that's currently in the query as:

                  SELECT DATE_FORMAT(x.date_entered, '%Y-%m-%d') AS date FROM x ORDER BY date ASC
                  

                  我想要做的是从那个日期减去 3 小时(格林威治标准时间问题),但我不能在 PHP 中做到这一点,因为 PHP 只知道日期部分,而不知道时间.

                  What I want to do is to subtract 3 hours from that date (GMT issues), but I can't do it in PHP as PHP only knows the date part, not the time.

                  推荐答案

                  mySQL 具有 DATE_SUB():

                  mySQL has DATE_SUB():

                  SELECT DATE_SUB(column, INTERVAL 3 HOUR)....
                  

                  但是尝试解决潜在的时区问题不是更好吗?

                  but would it not be better to try and sort out the underlying time zone issue instead?

                  这篇关于如何从 MySQL 中的日期时间中减去小时数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  ibtmp1是非压缩的innodb临时表的独立表空间,通过innodb_temp_data_file_path参数指定文件的路径,文件名和大小,默认配置为ibtmp1:12M:autoextend,也就是说在文件系统磁盘足够的情况下,这个文件大小是可以无限增长的。 为了避免ibtmp1文件无止境的暴涨导致
                  What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)
                  MySQL groupwise MAX() returns unexpected results(MySQL groupwise MAX() 返回意外结果)
                  MySQL SELECT most frequent by group(MySQL SELECT 按组最频繁)
                  Why Mysql#39;s Group By and Oracle#39;s Group by behaviours are different(为什么 Mysql 的 Group By 和 Oracle 的 Group by 行为不同)
                  MySQL GROUP BY DateTime +/- 3 seconds(MySQL GROUP BY DateTime +/- 3 秒)
                    <bdo id='LM8Vt'></bdo><ul id='LM8Vt'></ul>

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

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

                          1. <small id='LM8Vt'></small><noframes id='LM8Vt'>

                              <tbody id='LM8Vt'></tbody>