[Java] Date Related Term Memo

It's been a while since I was in charge of the server-side project. Moreover, the environment is db & windows & Java etc. (T, T) Therefore, I will make a note of terms and other matters related to studying.

the term

1. ISO-8601 calendar system

ISO international standard for date and time notation

Basic format: YYYYMMDDThhmmss + 0900 Example) 20200531T115959 + 0900

2. GMT (Greenwich mean solar time)

Local average solar time in Greenwich, England (0 degrees longitude) (The time when the average sun is in the south is noon) Greenwich.png | 経度0度0分0秒の基準子午線.png

Greenwich Observatory Old Main Building

3. UTC (Coordinated Universal Time coordinated)

Basically a cesium atomic clock using cesium atoms

JST (Japan Standard Time) UTC + 9 hours (time difference of 135 degrees east longitude)

UNIX time (POSIX) Formal seconds elapsed from UNIX epoch in UTC

Four. Gregorian calendar (new calendar)

It is a calendar system that has been used since October 15, 1582 (Gregorian calendar). (The 226th Pope Gregory XIII ordered the improvement of the Julian calendar, which was the previous lunar calendar.)

reference

"・ Wikiiso 8601" (https://ja.wikipedia.org/wiki/ISO_8601) [・ Wiki-GMT (Greenwich Mean Time)](https://ja.wikipedia.org/wiki/%E3%82%B0%E3%83%AA%E3%83%8B%E3%83%83%E3 % 82% B8% E6% A8% 99% E6% BA% 96% E6% 99% 82) [・ Wiki-UTC (Coordinated Universal Time) (https://ja.wikipedia.org/wiki/%E5%8D%94%E5%AE%9A%E4%B8%96%E7%95%8C%E6% 99% 82) ・ Wiki-UNIX time

JAVA (Version: 1.8)

1。OffsetDateTime An invariant representation of date / time using offsets. Stores all date and time fields to nanosecond precision, as well as offsets from UTC / Greenwich. Example 1) "2nd October 2007 at 13: 45.30.123456789 +02: 00" Example 2) Instance generation of(LocalDateTime date,ZoneOffset zone) of(LocalDate date, LocalTime time, ZoneOffset zone)

2。LocalDateTime An immutable date / time object that represents a date / hour (often displayed as year-month-day-hour-minute-second). You can also access other date and time fields (such as "day of the year", day of the week, "week number of the year"). Time is expressed to nanosecond precision. Example 1) "13: 45.30.123456789 on October 2, 2007" Example 2) Instance generation of(LocalDate date, LocalTime time)

3。Timestamp A thin wrapper around java.util.Date that the JDBC API can identify as a SQLTIMESTAMP value.

Example 1) Instance generation valueOf(LocalDateTime date)

reference

https://docs.oracle.com/javase/jp/8/docs/api/java/time/OffsetDateTime.html https://docs.oracle.com/javase/jp/8/docs/api/java/time/LocalDateTime.html https://docs.oracle.com/javase/jp/8/docs/api/java/sql/Timestamp.html

bonus

[[Java] Date / Time API] (https://www.ne.jp/asahi/hishidama/home/tech/java/datetime.html) [Swift] Date Royal Road (Date) [Kotlin] Date How to calculate date and time

Recommended Posts

[Java] Date Related Term Memo
Java memo
java anything memo
Java Silver memo
java, maven memo
Java related summary
Java SE 7 memo
java anything memo 2
Java specification memo
Java pattern memo
java basic knowledge memo
Java learning memo (method)
Java Kuche Day memo
java se 8 programmer Ⅰ memo
Java paid private memo
Java basic date manipulation
java lambda expression memo
(Memo) Java for statement
Java lambda expression [memo]
Date manipulation in Java 8
Java learning memo (interface)
[Java] Implicit inheritance memo
Java learning memo (inheritance)
java competitive programming memo
[Memo] Java Linked List
java: Add date [Note]
[Java] Date type conversion
Java (WebSphere Application Server) memo [1]
[Java] Variable name naming memo
Java memo (standard class) substring
Java learning memo (data type)
Java memo (standard class) length
Java Silver Study Method Memo
Create a java method [Memo] [java11]
Java Silver exam preparation memo
Java learning memo (logical operator)
Java learning memo (abstract class)
Java study memo 2 with Progate
View current date in Java
What are Java metrics? _Memo_20200818
Java HashMap, entrySet [Personal memo]
[Eclipse Java] Development environment setting memo
Java learning memo (creating an array)
Personal memo: Metaprogramming with Java reflection
JCA (Java Cryptography Architecture) Usage Memo
Java release date and EOL summary
[Java] Memo for naming class names
Date processing in Java (LocalDate: Initialization)
[Study session memo] Java Day Tokyo 2017
Java learning memo (while statement, do-while statement)
[MySQL] [java] Receive date and time
Java beginner's stumbling block [memo writing]
[Java] Date period duplication check sample
[Java] Processing time measurement method memo
I tried using Java memo LocalDate
Memo: [Java] Identify files with an update date of 1 day or less