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

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

        <tfoot id='ionlZ'></tfoot>

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

      1. <i id='ionlZ'><tr id='ionlZ'><dt id='ionlZ'><q id='ionlZ'><span id='ionlZ'><b id='ionlZ'><form id='ionlZ'><ins id='ionlZ'></ins><ul id='ionlZ'></ul><sub id='ionlZ'></sub></form><legend id='ionlZ'></legend><bdo id='ionlZ'><pre id='ionlZ'><center id='ionlZ'></center></pre></bdo></b><th id='ionlZ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ionlZ'><tfoot id='ionlZ'></tfoot><dl id='ionlZ'><fieldset id='ionlZ'></fieldset></dl></div>
      2. 如何為秒值打印高達(dá) 6 位精度的時(shí)間

        How to print time up to 6 digits of precision for seconds value(如何為秒值打印高達(dá) 6 位精度的時(shí)間)

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

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

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

              • <tfoot id='bUkWL'></tfoot>
                <legend id='bUkWL'><style id='bUkWL'><dir id='bUkWL'><q id='bUkWL'></q></dir></style></legend>
                  本文介紹了如何為秒值打印高達(dá) 6 位精度的時(shí)間的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我在列中有一個(gè)時(shí)間戳類型的值.假設(shè)我有一個(gè)值 2007-05-04 08:48:40.969774

                  I have a value in column which is of type timestamp. Lets say I have a value 2007-05-04 08:48:40.969774

                  現(xiàn)在,當(dāng)嘗試從數(shù)據(jù)庫中獲取值并將此時(shí)間戳值返回給函數(shù)時(shí),我應(yīng)該使用什么 SimpleDateFormatter 模式,以便也返回秒旁邊的小數(shù)部分.

                  Now, when trying to fetch the value from the database and return this timestamp value to a function, what SimpleDateFormatter pattern should I use so that the fraction part beside the seconds also gets returned.

                  我使用了 yyyy-MM-dd hh:mm:ss,但它只返回到秒數(shù),并忽略秒數(shù)旁邊的分?jǐn)?shù) (.969774).我還需要幫助以 6 位精度返回這個(gè)小數(shù)部分.

                  I have used yyyy-MM-dd hh:mm:ss, but that only returns till the seconds and ignores the fraction present beside the seconds(.969774). I need help in returning this fraction part also, with a 6-digits precision.

                  推薦答案

                  java.util.Date(或java.sql.Timestamp)的默認(rèn)格式化方式只有毫秒精度.您可以使用 yyyy-MM-dd hh:mm:ss.SSS 來獲得毫秒精度.

                  The default ways of formatting a java.util.Date (or java.sql.Timestamp) has only millisecond precision. You can use yyyy-MM-dd hh:mm:ss.SSS to get that millisecond precision.

                  java.sql.Timestamp 實(shí)際上確實(shí)具有(高達(dá))納秒精度(假設(shè)數(shù)據(jù)庫服務(wù)器和驅(qū)動程序?qū)嶋H上支持它).在 Java 8 中格式化它的最簡單方法是將時(shí)間戳轉(zhuǎn)換為 java.time.LocalDateTime(使用 Timestamp.toLocalDateTime())并使用 javajava.time.format.DateTimeFormatter 中的 .time 格式選項(xiàng),最多支持納秒.

                  A java.sql.Timestamp actually does have (up to) nanosecond precision (assuming the database server and the driver actually support it). The easiest way to format it in Java 8 is to convert the timestamp to a java.time.LocalDateTime (using Timestamp.toLocalDateTime()) and use the java.time formatting options in java.time.format.DateTimeFormatter which support up to nanoseconds.

                  如果您使用 Java 7 或更早版本,則需要付出一些額外的努力,因?yàn)槠胀ǖ娜掌诟袷交绦虿恢С炙?例如,您可以使用帶有模式 yyyy-MM-dd hh:mm:ss 的日期格式化程序(僅格式化為秒)并附加亞秒納秒(帶有適當(dāng)?shù)牧闾畛?Timestamp.getNanos() 你自己.

                  If you use Java 7 or earlier it will take some extra effort, as the normal date formatters don't support it. For example you could use a dateformatter with pattern yyyy-MM-dd hh:mm:ss (to only format up to seconds) and append the sub-second nano seconds (with appropriate zero-padding) of Timestamp.getNanos() yourself.

                  這篇關(guān)于如何為秒值打印高達(dá) 6 位精度的時(shí)間的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  quot;Char cannot be dereferencedquot; error(“Char 不能被取消引用錯(cuò)誤)
                  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 操作數(shù)的三元表達(dá)式的類型是什么?)
                  Read a text file and store every single character occurrence(讀取文本文件并存儲出現(xiàn)的每個(gè)字符)
                  Why do I need to explicitly cast char primitives on byte and short?(為什么我需要在 byte 和 short 上顯式轉(zhuǎn)換 char 原語?)

                  • <tfoot id='u7I5V'></tfoot>

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

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

                      1. <legend id='u7I5V'><style id='u7I5V'><dir id='u7I5V'><q id='u7I5V'></q></dir></style></legend>
                          <bdo id='u7I5V'></bdo><ul id='u7I5V'></ul>
                          1. 主站蜘蛛池模板: 久久不射网| 国产成人在线一区二区 | 天堂网中文 | 男人影音 | 久久这里只有精品首页 | 超碰电影 | 国产精品成av人在线视午夜片 | 久久一二 | 国产精品美女久久久久久免费 | 亚洲国产精品久久久久秋霞不卡 | 狠狠爱免费视频 | 成人日批视频 | 人人干天天干 | 91色在线| 免费看日韩视频 | 精品中文在线 | 91日b| 午夜一级做a爰片久久毛片 精品综合 | xxxxx黄色片| 国产一区2区 | 91国产在线视频在线 | 亚洲午夜视频在线观看 | 中文字幕视频在线免费 | 91久久精品一区二区二区 | 国产免费观看一级国产 | 午夜精品久久久久久不卡欧美一级 | 精品欧美一区二区三区免费观看 | 亚洲一区二区av | 国产午夜三级一区二区三 | 欧美日韩综合一区 | 国产乱码精品1区2区3区 | 一区在线观看视频 | 久久久久一区 | 国产精品一区久久久 | 鲁一鲁资源影视 | 亚洲福利视频网 | 久久高清亚洲 | 亚洲激情一区二区三区 | 91久久久久 | 国产一级在线观看 | 色婷婷狠狠|