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

    <bdo id='8MJ3L'></bdo><ul id='8MJ3L'></ul>
  • <legend id='8MJ3L'><style id='8MJ3L'><dir id='8MJ3L'><q id='8MJ3L'></q></dir></style></legend>
    1. <tfoot id='8MJ3L'></tfoot>

      <small id='8MJ3L'></small><noframes id='8MJ3L'>

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

        mysql中UTC日期

        Date in UTC in mysql(mysql中UTC日期)
            <tbody id='ZWcG0'></tbody>
        • <tfoot id='ZWcG0'></tfoot>

            • <bdo id='ZWcG0'></bdo><ul id='ZWcG0'></ul>

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

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

                  本文介紹了mysql中UTC日期的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我有一個表,其中包含數據類型為 DATETIME 的字段.我使用 java 在此表中保留一條記錄,并按如下方式計算當前日期.

                  I have a table which has field with data type as DATETIME. I persist a record in this table using java and I calculate current date as as following.

                  Date date = Calendar.getInstance(TimeZone.getTimeZone("UTC")).getTime();
                  

                  但是當我檢查我的表時,它再次將這個時間轉換為本地時區.

                  But When I check my table, it again converts this time into local timezone.

                  誰能給我解釋一下,如何在數據庫中以 UTC 時區存儲日期.

                  Can some one please explain to me, how to store date in UTC timezone in database.

                  @代碼

                  我有一個數據庫實體 'Referral' 對應于日期成員數據類型為 java.util.Date 的表,并使用休眠來保存它.

                  I have a db entity 'Referral' corresponding to table with date member data type as java.util.Date and using hibernate to save it.

                  Referral ref = new Referral();
                  ref.setCreationDate(Calendar.getInstance(TimeZone.getTimeZone("UTC")).getTime());
                  referralDAO.save(ref);
                  

                  謝謝

                  吉騰德拉

                  推薦答案

                  MySql DATETIME 以與時區無關的方式存儲.它只存儲年/月/日/小時/分鐘/秒

                  MySql DATETIME is stored in a time zone agnostic manner. It just stores year/month/day/hour/minute/second

                  您如何解釋該信息取決于您和您的應用程序.如果您將其存儲為 UTC,那么當您檢索它時,您必須確保也將其解釋為 UTC.

                  How you interpret that information is up to you and your application. If you are storing it as UTC, then when you retrieve it you must make sure to interpret it as UTC as well.

                  您可能對這個 SO 問題感興趣:如何在 Java 中獲取 UTC 或 GMT 的當前日期和時間?

                  You might be interested in this SO question: How can I get the current date and time in UTC or GMT in Java?

                  正如該問題的答案所述:

                  As mentioned in the answer to that question:

                  java.util.Date 是 always 在 UTC 中.是什么讓你認為它在本地時間?我懷疑問題是您正在通過實例顯示它使用本地的日歷時區,或可能使用Date.toString() 也使用當地時區.

                  java.util.Date is always in UTC. What makes you think it's in local time? I suspect the problem is that you're displaying it via an instance of Calendar which uses the local timezone, or possibly using Date.toString() which also uses the local timezone.

                  這篇關于mysql中UTC日期的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  quot;Char cannot be dereferencedquot; error(“Char 不能被取消引用錯誤)
                  Java Switch Statement - Is quot;orquot;/quot;andquot; possible?(Java Switch 語句 - 是“或/“和可能的?)
                  Java Replace Character At Specific Position Of String?(Java替換字符串特定位置的字符?)
                  What is the type of a ternary expression with int and char operands?(具有 int 和 char 操作數的三元表達式的類型是什么?)
                  Read a text file and store every single character occurrence(讀取文本文件并存儲出現的每個字符)
                  Why do I need to explicitly cast char primitives on byte and short?(為什么我需要在 byte 和 short 上顯式轉換 char 原語?)

                    <tbody id='JUgNA'></tbody>
                  • <small id='JUgNA'></small><noframes id='JUgNA'>

                    <i id='JUgNA'><tr id='JUgNA'><dt id='JUgNA'><q id='JUgNA'><span id='JUgNA'><b id='JUgNA'><form id='JUgNA'><ins id='JUgNA'></ins><ul id='JUgNA'></ul><sub id='JUgNA'></sub></form><legend id='JUgNA'></legend><bdo id='JUgNA'><pre id='JUgNA'><center id='JUgNA'></center></pre></bdo></b><th id='JUgNA'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='JUgNA'><tfoot id='JUgNA'></tfoot><dl id='JUgNA'><fieldset id='JUgNA'></fieldset></dl></div>
                    1. <legend id='JUgNA'><style id='JUgNA'><dir id='JUgNA'><q id='JUgNA'></q></dir></style></legend>
                        <tfoot id='JUgNA'></tfoot>
                            <bdo id='JUgNA'></bdo><ul id='JUgNA'></ul>
                          • 主站蜘蛛池模板: 久久精品中文字幕 | 亚洲乱码国产乱码精品精的特点 | 久久久国产一区 | 精品一区二区三区在线观看国产 | 国产亚洲网站 | 亚洲最大av | 欧美国产日韩一区 | 91精品国产综合久久精品图片 | 亚洲一区二区国产 | 国产免费观看久久黄av片涩av | 99久久婷婷国产综合精品电影 | 成人国产一区二区三区精品麻豆 | 国产美女一区二区三区 | 国产精品99久久免费观看 | 亚洲精品视频在线 | 老司机午夜性大片 | 日韩一区二区三区av | 97视频成人| 日韩欧美字幕 | 久久不卡区 | 精品久久久久久亚洲综合网 | 精品一区国产 | 午夜寂寞影院在线观看 | 久久久精品一区二区三区 | 黄色精品| 亚洲精品国产一区 | 成人在线免费看 | 国产精品综合一区二区 | 91在线看视频 | 日日骚网 | 做a视频 | 亚洲日本三级 | 久久夜视频 | 国产成人网 | 久久久久久一区 | www.888www看片 | 亚洲一区视频在线 | 夜夜摸天天操 | 免费在线色 | 久久九九色 | 欧美精品久久久久久 |