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

        如何修改現(xiàn)有表以添加時(shí)區(qū)

        How to modify existing tables for timezone addition(如何修改現(xiàn)有表以添加時(shí)區(qū))

          <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>
                  本文介紹了如何修改現(xiàn)有表以添加時(shí)區(qū)的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  我有一個(gè)包含 500 多個(gè)表的大型應(yīng)用程序,我必須將應(yīng)用程序轉(zhuǎn)換為時(shí)區(qū)感知(當(dāng)前應(yīng)用程序使用 new java.util.Date(), GETDATE() 與服務(wù)器的時(shí)區(qū)).即不支持任何時(shí)區(qū).

                  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.

                  為了簡(jiǎn)化開(kāi)發(fā),我已將此任務(wù)分為幾個(gè)步驟,我確定的第一個(gè)步驟是根據(jù)服務(wù)器的時(shí)區(qū)將所有舊日期更改為 UTC.(主要位于一個(gè)時(shí)區(qū),所以這是我最好的猜測(cè))

                  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)

                  接下來(lái),我需要修改數(shù)據(jù)庫(kù)和應(yīng)用程序代碼以使用時(shí)區(qū)名稱和偏移量以 UTC 格式保存所有日期,這就是我的問(wèn)題所在...

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

                  我將如何修改數(shù)據(jù)庫(kù)/表以很好地支持這一點(diǎn)?

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

                  我的想法是:

                  1. 對(duì)于表中的每個(gè)日期/時(shí)間列,添加兩個(gè)額外的列(用于 tz-name 和偏移量)
                    • 感覺(jué)很糟糕的設(shè)計(jì)
                  • 雖然更便攜,但這張表最終將包含數(shù)百萬(wàn)行,因?yàn)樗菍⒄麄€(gè)數(shù)據(jù)庫(kù)的日期塞進(jìn)一張表中
                  • 雖然不可移植,但這似乎是最好的(關(guān)系)選項(xiàng)

                  有人有其他想法或最佳實(shí)踐嗎?

                  Does anyone have any other ideas or best-practices?

                  推薦答案

                  根據(jù)我的經(jīng)驗(yàn),您通常應(yīng)該將數(shù)據(jù)存儲(chǔ)為 UTC,并將相關(guān)時(shí)區(qū)放在單獨(dú)的列中.擁有一張時(shí)區(qū)表并存儲(chǔ)時(shí)區(qū)鍵是關(guān)系數(shù)據(jù)庫(kù)的合理做法.

                  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.

                  不過(guò),在這種情況下,您的所有數(shù)據(jù)都已在當(dāng)?shù)貢r(shí)間,因此在這種情況下,您可以將當(dāng)?shù)貢r(shí)間存儲(chǔ)在時(shí)間列中,并為時(shí)區(qū)添加一列.這樣您就不必轉(zhuǎn)換數(shù)據(jù)庫(kù)中已有的日期.

                  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.

                  沒(méi)有必要存儲(chǔ)偏移量,除非您最終注意到從日期和區(qū)域轉(zhuǎn)換為偏移量太耗時(shí).

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

                  這篇關(guān)于如何修改現(xiàn)有表以添加時(shí)區(qū)的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  How to use windowing functions efficiently to decide next N number of rows based on N number of previous values(如何有效地使用窗口函數(shù)根據(jù) N 個(gè)先前值來(lái)決定接下來(lái)的 N 個(gè)行)
                  reuse the result of a select expression in the quot;GROUP BYquot; clause?(在“GROUP BY中重用選擇表達(dá)式的結(jié)果;條款?)
                  Does ignore option of Pyspark DataFrameWriter jdbc function ignore entire transaction or just offending rows?(Pyspark DataFrameWriter jdbc 函數(shù)的 ignore 選項(xiàng)是忽略整個(gè)事務(wù)還是只是有問(wèn)題的行?) - IT屋-程序員軟件開(kāi)發(fā)技
                  Error while using INSERT INTO table ON DUPLICATE KEY, using a for loop array(使用 INSERT INTO table ON DUPLICATE KEY 時(shí)出錯(cuò),使用 for 循環(huán)數(shù)組)
                  pyspark mysql jdbc load An error occurred while calling o23.load No suitable driver(pyspark mysql jdbc load 調(diào)用 o23.load 時(shí)發(fā)生錯(cuò)誤 沒(méi)有合適的驅(qū)動(dòng)程序)
                  How to integrate Apache Spark with MySQL for reading database tables as a spark dataframe?(如何將 Apache Spark 與 MySQL 集成以將數(shù)據(jù)庫(kù)表作為 Spark 數(shù)據(jù)幀讀取?)
                      <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>

                            主站蜘蛛池模板: 欧美一区免费在线观看 | 岛国av在线免费观看 | 东京av男人的天堂 | 国产视频一区二区三区四区五区 | 国产精品久久久久国产a级 欧美日韩国产免费 | 日本五月婷婷 | 亚洲精品视频在线播放 | 国产精品免费福利 | 亚洲36d大奶网 | 国产一级片 | 欧美日韩在线视频一区二区 | 国产九九精品视频 | 国产成都精品91一区二区三 | 精品一区二区久久久久久久网精 | 国产精品www| 91精品国产综合久久久久久蜜臀 | 国产成人免费 | 亚洲一区二区在线播放 | 亚洲天堂男人的天堂 | 婷婷毛片| 国产欧美视频一区 | 国产成人叼嘿视频在线观看 | 免费国产视频 | 久久久91 | 欧美日韩中文字幕在线 | 色综合久| 天堂中文字幕av | 黑人一级黄色大片 | 五月精品视频 | h视频在线观看免费 | 噜噜噜色网 | 青青久久av北条麻妃海外网 | 国产一区二区三区色淫影院 | 美女一级毛片 | 久久国内精品 | 一区二区精品 | 一区二区在线 | 国产一区二区 | 欧美成人a∨高清免费观看 老司机午夜性大片 | 婷婷久久五月天 | 黄色免费三级 |