更新時間:2020-08-17 16:35:34 來源:動力節(jié)點 瀏覽8871次
名詞解釋
時刻:時刻是時間上的某個瞬間,,或是時間軸上的某個點。時刻可以作為時間間隔的起點和終點
時代:一個時代是用作測量其他時刻的起源的瞬間。時代是在1970-01-01T00:00:00Z。時代之后的時刻具有正值,而時代之前的時刻具有負(fù)值。
java 8類說明
java.time包含的api都是基于iso 8601的。
1.java.time.LocalDate:LocalDate是一個不可變的類,它表示默認(rèn)格式(yyyy-MM-dd)的日期
2.java.time.LocalTime:LocalTime是一個不可變的類,它的實例代表一個符合人類可讀格式的時間,默認(rèn)格式是hh:mm:ss.zzz
ISO字符替代說明
[Y]?represents?a?digit?used?in?the?time?element?“year”;
[M]?represents?a?digit?used?in?the?time?element?“month”;
[D]?represents?a?digit?used?in?the?time?element?“day”;
[w]?represents?a?digit?used?in?the?time?element?“week”;
[h]?represents?a?digit?used?in?the?time?element?“hour”;
[m]?represents?a?digit?used?in?the?time?element?“minute”;
[s]?represents?a?digit?used?in?the?time?element?“second”;
[n]?represents?a?digit?from?a?positive?integer?or?zero;
[±]?represents?a?plus?sign?[+]?if?in?combination?with?the?following?element?a?positive?value?or?zero?needs?to?be?represented?(in?this?case,?unless?explicitly?stated?otherwise,?the?plus?sign?shall?not?be?omitted),?or?a?minus?sign?[?]?if?in?combination?with?the?following?element?a?negative?value?needs?to?be?represented.
In?addition?the?following?convention?applies:
[_]?When?any?of?the?characters?representing?a?digit?is?underlined,?it?represents?zero?or?more?digits
in?the?corresponding?date?and?time?representation.
Other?characters?in?the?date?and?time?format?representations?are?copied?in?the?date?and?time
representations.
時間格式收錄
以上就是動力節(jié)點java培訓(xùn)機構(gòu)的小編針對“Java簡單日期類型時間格式的詳解”的內(nèi)容進行的回答,希望對大家有所幫助,如有疑問,請在線咨詢,有專業(yè)老師隨時為你服務(wù)。
相關(guān)閱讀
初級 202925
初級 203221
初級 202629
初級 203743