Introduction to
Date and Time API
HASUNUMA Kenji
Vice president, GlassFish Users Group Japan
k.hasunuma@coppermine.jp
Twitter: @btnrouge
November 10, 2012
java.util.Dateͷ՝
wϑΟʔϧυૢ࡞͕໘
w ϑΟʔϧυ͕࣮ࡍͷ
w ݄͕0͔Β࢝·Δ ݄ˠɺ݄ˠ
w෦ͱ࣌ࠁ෦͕ࠞࡏ͍ͯ͠Δ
wԋࢉͱϑΥʔϚοτػೳ͕ශऑ
Slide 6
Slide 6 text
JSR 310
Date and Time API
Slide 7
Slide 7 text
Michael Nascimento Santos
Stephen Colebourne
Roger Riggs
Slide 8
Slide 8 text
JSR 310 : Date and Time API
wDateɺCalendarɺDateFormatΛஔ͖
͑Δ͜ͱ͕త
wISO 8601ܗࣜͷɾ࣌ࠁදݱ
wImmutable͔ͭεϨουηʔϑͳAPI
wઃܭࢥJoda-Timeʹࠅࣅ
Slide 9
Slide 9 text
Joda-Time JSR 310
Slide 10
Slide 10 text
Second System Syndrome
Slide 11
Slide 11 text
More simply
Slide 12
Slide 12 text
JSR 310 : Date and Time API
20072݄JSR 310ঝೝɺEGൃ
20085݄JavaOne 2008Ͱൃද
20103݄Early Draft Review (1ճ)
201210݄Early Draft Review (2ճ)
201310݄ Java SE 8ϦϦʔε
0⒎TFU%BUF5JNF͔Β*OTUBOUΛऔಘ
औಘͨ͠*OTUBOU͔Β%BUFΛੜ
OffsetDateTime dateTime =
OffsetDateTime.now();
Instant instant =
dateTime.toInstant();
Date date = new Date(instant);