久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

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

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

      1. <tfoot id='pDnuW'></tfoot>

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

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

        如何修改現有表以添加時區

        How to modify existing tables for timezone addition(如何修改現有表以添加時區)

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

          <legend id='ysEWi'><style id='ysEWi'><dir id='ysEWi'><q id='ysEWi'></q></dir></style></legend>
            <bdo id='ysEWi'></bdo><ul id='ysEWi'></ul>

              <tbody id='ysEWi'></tbody>

              <i id='ysEWi'><tr id='ysEWi'><dt id='ysEWi'><q id='ysEWi'><span id='ysEWi'><b id='ysEWi'><form id='ysEWi'><ins id='ysEWi'></ins><ul id='ysEWi'></ul><sub id='ysEWi'></sub></form><legend id='ysEWi'></legend><bdo id='ysEWi'><pre id='ysEWi'><center id='ysEWi'></center></pre></bdo></b><th id='ysEWi'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ysEWi'><tfoot id='ysEWi'></tfoot><dl id='ysEWi'><fieldset id='ysEWi'></fieldset></dl></div>
                  <tfoot id='ysEWi'></tfoot>
                  本文介紹了如何修改現有表以添加時區的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我有一個包含 500 多個表的大型應用程序,我必須將應用程序轉換為時區感知(當前應用程序使用 new java.util.Date(), GETDATE() 與服務器的時區).即不支持任何時區.

                  I have a large application with 500+ tables, I have to convert the application to be timezone aware (currently application uses new java.util.Date(), GETDATE() with server's timezone). i.e. no timezone support whatsoever.

                  為了簡化開發,我已將此任務分為幾個步驟,我確定的第一個步驟是根據服務器的時區將所有舊日期更改為 UTC.(主要位于一個時區,所以這是我最好的猜測)

                  I have organised this task into a few steps so as to ease development, my first identified step is to change all old dates to UTC based on the server's timezone. (mostly located in one timezone, so this is my best guess)

                  接下來,我需要修改數據庫和應用程序代碼以使用時區名稱和偏移量以 UTC 格式保存所有日期,這就是我的問題所在...

                  Next, I need to modify the database and application code to save all dates in UTC with a timezone name and offset, this is where my problem comes in...

                  我將如何修改數據庫/表以很好地支持這一點?

                  How would i go about modifying the database/tables to support this in a good manner?

                  我的想法是:

                  1. 對于表中的每個日期/時間列,添加兩個額外的列(用于 tz-name 和偏移量)
                    • 感覺很糟糕的設計
                  • 雖然更便攜,但這張表最終將包含數百萬行,因為它是將整個數據庫的日期塞進一張表中
                  • 雖然不可移植,但這似乎是最好的(關系)選項

                  有人有其他想法或最佳實踐嗎?

                  Does anyone have any other ideas or best-practices?

                  推薦答案

                  根據我的經驗,您通常應該將數據存儲為 UTC,并將相關時區放在單獨的列中.擁有一張時區表并存儲時區鍵是關系數據庫的合理做法.

                  In my experience you should generally store the data as UTC, with the relevant timezone in a separate column. Having a table for timezones and storing the timezone key is the reasonable thing to do with a relational database.

                  不過,在這種情況下,您的所有數據都已在當地時間,因此在這種情況下,您可以將當地時間存儲在時間列中,并為時區添加一列.這樣您就不必轉換數據庫中已有的日期.

                  In this case though, all your data is in a local time already, so in this case you can store the local time in the time column, and add a column for the time zone. That way you don't have to convert the dates that are already in the database.

                  沒有必要存儲偏移量,除非您最終注意到從日期和區域轉換為偏移量太耗時.

                  Storing offset is not necessary, unless you end up noticing that converting from date and zone to offset is too time-consuming.

                  這篇關于如何修改現有表以添加時區的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to use windowing functions efficiently to decide next N number of rows based on N number of previous values(如何有效地使用窗口函數根據 N 個先前值來決定接下來的 N 個行)
                  reuse the result of a select expression in the quot;GROUP BYquot; clause?(在“GROUP BY中重用選擇表達式的結果;條款?)
                  Does ignore option of Pyspark DataFrameWriter jdbc function ignore entire transaction or just offending rows?(Pyspark DataFrameWriter jdbc 函數的 ignore 選項是忽略整個事務還是只是有問題的行?) - IT屋-程序員軟件開發技
                  Error while using INSERT INTO table ON DUPLICATE KEY, using a for loop array(使用 INSERT INTO table ON DUPLICATE KEY 時出錯,使用 for 循環數組)
                  pyspark mysql jdbc load An error occurred while calling o23.load No suitable driver(pyspark mysql jdbc load 調用 o23.load 時發生錯誤 沒有合適的驅動程序)
                  How to integrate Apache Spark with MySQL for reading database tables as a spark dataframe?(如何將 Apache Spark 與 MySQL 集成以將數據庫表作為 Spark 數據幀讀取?)
                      <bdo id='eoa0n'></bdo><ul id='eoa0n'></ul>
                      <i id='eoa0n'><tr id='eoa0n'><dt id='eoa0n'><q id='eoa0n'><span id='eoa0n'><b id='eoa0n'><form id='eoa0n'><ins id='eoa0n'></ins><ul id='eoa0n'></ul><sub id='eoa0n'></sub></form><legend id='eoa0n'></legend><bdo id='eoa0n'><pre id='eoa0n'><center id='eoa0n'></center></pre></bdo></b><th id='eoa0n'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='eoa0n'><tfoot id='eoa0n'></tfoot><dl id='eoa0n'><fieldset id='eoa0n'></fieldset></dl></div>

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

                        1. <tfoot id='eoa0n'></tfoot>

                              <tbody id='eoa0n'></tbody>

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

                            主站蜘蛛池模板: 尤物在线 | 国产精品日女人 | 在线午夜电影 | 国产成人99久久亚洲综合精品 | 亚洲精选久久 | 三级av免费 | 在线播放国产一区二区三区 | 色婷婷一区 | 草草视频在线播放 | 国产日韩欧美另类 | 亚洲一区高清 | 久久精品亚洲精品国产欧美kt∨ | 亚洲免费一区二区 | 久色一区 | 人人玩人人添人人澡欧美 | 成人精品久久久 | 伊人伊成久久人综合网站 | 日韩精品成人一区二区三区视频 | 午夜激情一区 | 中文字幕 在线观看 | 久久久久久九九九九九九 | 黄色成人国产 | 国产成人精品午夜 | 国产精品不卡一区 | 国产日韩视频 | 成人在线免费视频 | 国产免费视频 | 午夜精品一区二区三区在线视频 | 成人妇女免费播放久久久 | 国产成人精品久久二区二区 | 亚洲 欧美 日韩 在线 | 天天天插| 亚洲午夜精品一区二区三区他趣 | 一区不卡在线观看 | 中文字幕国 | 午夜精品久久久久久久久久久久久 | 国产成人免费在线 | 国产精品国产三级国产aⅴ中文 | 日韩精品一区二区久久 | 二区三区视频 | 日韩精品一 |