专注Java教育14年 全国咨询/投诉热线:400-8080-105
动力节点LOGO图
始于2009,口口相传的Java黄埔军校
首页 学习攻略 Java简单日期类型时间格式的详解

Java简单日期类型时间格式的详解

更新时间:2020-08-17 16:35:34 来源:动力节点 浏览8378次

名词解释

时刻:时刻是时间上的某个瞬间,,或是时间轴上的某个点。时刻可以作为时间间隔的起点和终点

时代:一个时代是用作测量其他时刻的起源的瞬间。时代是在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简单日期类型

时间格式收录

java简单日期类型

以上就是动力节点java培训机构的小编针对“Java简单日期类型时间格式的详解”的内容进行的回答,希望对大家有所帮助,如有疑问,请在线咨询,有专业老师随时为你服务。

提交申请后,顾问老师会电话与您沟通安排学习

免费课程推荐 >>
技术文档推荐 >>