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

        Node Sequelize - insert date quot;as isquot; without converting to UTC(节点续集 - “按原样插入日期无需转换为 UTC)

      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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Pause youtube video, youtube api(暂停 youtube 视频,youtube api)
                  Youtube iframe api not triggering onYouTubeIframeAPIReady(Youtube iframe api 未触发 onYouTubeIframeAPIReady)
                  How can I stop a video with Javascript in Youtube?(如何在 Youtube 中停止使用 Javascript 的视频?)
                  How to call Greasemonkey#39;s GM_ functions from code that must run in the target page scope?(如何从必须在目标页面范围内运行的代码中调用 Greasemonkey 的 GM_ 函数?)
                  How do you mute an embedded Youtube player?(如何使嵌入式 Youtube 播放器静音?)
                  How to get number of video views with YouTube API?(如何使用 YouTube API 获取视频观看次数?)
                    <tbody id='wkQxp'></tbody>

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