更新時間:2020-08-17 16:35:34 來源:動力節點 瀏覽8894次
名詞解釋
時刻:時刻是時間上的某個瞬間,,或是時間軸上的某個點。時刻可以作為時間間隔的起點和終點
時代:一個時代是用作測量其他時刻的起源的瞬間。時代是在1970-01-01T00:00:00Z。時代之后的時刻具有正值,而時代之前的時刻具有負值。
java 8類說明
java.time包含的api都是基于iso 8601的。
1.java.time.LocalDate:LocalDate是一個不可變的類,它表示默認格式(yyyy-MM-dd)的日期
2.java.time.LocalTime:LocalTime是一個不可變的類,它的實例代表一個符合人類可讀格式的時間,默認格式是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.
時間格式收錄
以上就是動力節點java培訓機構的小編針對“Java簡單日期類型時間格式的詳解”的內容進行的回答,希望對大家有所幫助,如有疑問,請在線咨詢,有專業老師隨時為你服務。
0基礎 0學費 15天面授
有基礎 直達就業
業余時間 高薪轉行
工作1~3年,加薪神器
工作3~5年,晉升架構
提交申請后,顧問老師會電話與您溝通安排學習