Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Java 8 Date Time Hack Day
1. Java 8 Date Time Hack
Day
Stephen Colebourne
Roger Riggs
Richard Warburton
James Gough
2. Who are we?
• JSR 310 Expert Group
• Stephen Colebourne @jodastephen
• Roger.Riggs@oracle.com
• London Java Community JCP Group
• Richard Warburton @RichardWarburto
• Jim Gough @JavaJimLondon
2
3. Example From It’s High Time
@JavaOne 2008
• How many bugs in this code?
Date date = new Date(2007, 12, 13, 16,
40);
TimeZone zone =
TimeZone.getInstance("Asia/HongKong");
Calendar cal = new
GregorianCalendar(date, zone);
DateFormat fm = new
SimpleDateFormat("HH:mm Z");
String str = fm.format(cal);
3
4. Example From It’s High Time
@JavaOne 2008
• 6 bugs in the code!
Date date = new Date(2007, 12, 13, 16,
40);
TimeZone zone =
TimeZone.getInstance("Asia/Hong_Kong");
Calendar cal = new
GregorianCalendar(date, zone);
DateFormat fm = new
SimpleDateFormat("HH:mm Z");
String str = fm.format(cal);
4
5. Introducing Some New Concepts
• Core Terms
• Date
• Time
• Usage
• Standard
• Timezones
• By offset
• Calendaring Systems
• New Date Formatter
5
6. No More Upfront Help...
• The point of today is to see how Java
Developers can use and understand the API
• The JavaDoc is available at
– http://tinyurl.com/310jdoc
• Instructors will be around to give help and
note down feedback
6
7. Project Structure (3 Sections)
• Basic
– Introduction to basic DateTime operations
• Explore
– Alterations, comparisons and multiple calendars
• Project
– School holiday exchange task
7