• <bdo id='2ZCwk'></bdo><ul id='2ZCwk'></ul>

    1. <small id='2ZCwk'></small><noframes id='2ZCwk'>

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

        节点续集 - “按原样"插入日期无需转换为 UTC

        时间:2023-09-03

      2. <small id='Za3po'></small><noframes id='Za3po'>

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

                  <bdo id='Za3po'></bdo><ul id='Za3po'></ul>

                  <tfoot id='Za3po'></tfoot>
                  本文介绍了节点续集 - “按原样"插入日期无需转换为 UTC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试运行一个简单的查询,例如

                  Im trying to run a simple query like

                  Insert into table (somedate) values ('2018-06-11 23:59:00')
                  

                  但 Sequelize 将其执行为

                  but Sequelize executes it as

                  Insert into table (somedate) values ('2018-06-12 02:59:00')
                  

                  是否可以选择按原样"设置日期而不以任何方式转换或更改它?

                  Is there an option to set the date "as is" without converting or changing it in any way?

                  推荐答案

                  你实际上可以告诉 sequelize 在阅读时不要将其转换为 UTC,你也可以在写作时提供一个时区

                  You can actually tell sequelize not to convert it to UTC while reading and you can also provide a time zone for while writing

                  const sequelize = new Sequelize('db_name', 'postgres', 'postgres', {
                    host: '127.0.0.1',
                    dialectOptions: {
                      useUTC: false //for reading from database
                    },
                    dialect: 'postgres',
                    timezone: '+05:30', // for writng
                  }); 
                  

                  这篇关于节点续集 - “按原样"插入日期无需转换为 UTC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:同步执行 Sequelize 查询 下一篇:如何将对象作为数据类型传递给 sequilize 中的数据模型?

                  相关文章

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

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

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