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 中的日期时间中减去小时数?

        时间:2023-05-23
        <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 中的日期时间中减去小时数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在 Postgresql 中模拟 MySQL 的 ORDER BY FIELD() 下一篇:MySQL - SQL_BIG_SELECTS

                  相关文章

                    <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'>