SlideShare ist ein Scribd-Unternehmen logo
1 von 16
Downloaden Sie, um offline zu lesen
LJC/JCP Committee
                         Java Dating
                  By James Gough




Thursday, 14 July 2011
LJC/JCP

          •      Who am I?

          •      What is the LJC/JCP?

          •      Why get involved?




Thursday, 14 July 2011
Who am I?
          •      James Gough

                • jpgough@gmail.com
                • Twitter: goughjam
          •      Java developer for 8 years, 4 years industry experience

          •      Work at a large investment bank developing Flex and Java

          •      Run my own company in spare time developing iOS
                 applications

                                                                   3


Thursday, 14 July 2011
LJC/JCP
          •      LJC recently elected onto the JCP committee

          •      JCP (Java Community Process)

                         •   The JCP is the mechanism for developing
                             standard technical specifications for the
                             Java technology

          •      Interested? Ben Evans @kittylst on twitter, or
                 find me at the bar on Tuesday


                                                              4


Thursday, 14 July 2011
Why get involved?
          •      Chance to have a say

          •      Discover more about Java and the
                 inner workings

          •      Get involved on projects and
                 contribute to Java directly

          •      Offered to do a lightning talk
                •        Coming soon: Java memory pub

                                                        5


Thursday, 14 July 2011
Dates?
          •      The thing that's bothering me at the
                 moment is dating, there’s several things
                 to be aware of:

                •        Choosing a good restaurant

                •        What to wear

                •        ....

                                                      6


Thursday, 14 July 2011
Java Dates
          • Java Date and Calendar
          • Joda Time
          • JSR-310
                                      7


Thursday, 14 July 2011
Java Date
          •      Java Date has been in the language since January 23, 1996

          •      Many good discussions about what’s wrong with dates

          •      Mutability

          •      Date is a DateTime, but there are other classes for SQL

          •      No Timezones

          •      Not easy to use




                                                                   8


Thursday, 14 July 2011
Calendar

          • Still mutable
          • Can’t format a date directly

                                           9


Thursday, 14 July 2011
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);

                                                  10


Thursday, 14 July 2011
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);

                                                  11


Thursday, 14 July 2011
Joda Time
          •      Instant

                •        Moment in time, represented by DateTime. DateTime
                         is immutable

          •      Interval

                •        An interval of time from one instant to another. Both
                         end points have same Chronology and TimeZone

          •      Duration

                •        Duration of time measured in milliseconds. No
                         timezone of chronology applies
                                                                       12


Thursday, 14 July 2011
Joda Time
          •      Period

                •        A period of time defined in terms of fields (e.g. +1 month)

          •      Chronology

                •        A calculation engine supporting complex calendar rules

                •        In most this can be ignored, important to the internal design, but
                         not to the standard user using ISOChronology

          •      Timezones

                •        DateTimeZone zone = DateTimeZone.forID
                         ("Europe/London");


                                                                                  13


Thursday, 14 July 2011
JSR-310
          •      Human/Machine Timelines

                •        Requirement to have a separation of concerns
                         between human and machine timelines

                •        DateTime is better thought of as a LocalDateTime and
                         a timezone

          •      Pluggable Chronology

                •        Restrict DateTime classes to a single calendar system

          •      Nulls

                •        Null means 0 in most cases, ouch!
                                                                        14


Thursday, 14 July 2011
Getting Involved
          •      ThreeTen is now on GitHub

          •      Open project that can be contributed to

          •      A few pull requests have been made since moving to
                 GitHub

          •      Accept the legal agreement

          •      Mailing List: threeten-
                 develop@lists.sourceforge.net

                                                                15


Thursday, 14 July 2011
Contact
          •      James Gough

                • jpgough@gmail.com
                • Twitter: goughjam


                                      3
                                      16


Thursday, 14 July 2011

Weitere ähnliche Inhalte

Andere mochten auch

Denúncia da Lava Jato contra João Santana
Denúncia da Lava Jato contra João SantanaDenúncia da Lava Jato contra João Santana
Denúncia da Lava Jato contra João SantanaMiguel Rosario
 
Логистика на аутсорс: гибкость в период нестабильности IForum2014
Логистика на аутсорс: гибкость в период нестабильности IForum2014Логистика на аутсорс: гибкость в период нестабильности IForum2014
Логистика на аутсорс: гибкость в период нестабильности IForum2014TOCHKA
 
Croatian Govt, the most communicative government in the world?
Croatian Govt, the most communicative government in the world?Croatian Govt, the most communicative government in the world?
Croatian Govt, the most communicative government in the world?Tomislav Korman
 
Questão de ordem - suspeição do relator da Comissão de Impeachment
Questão de ordem - suspeição do relator da Comissão de ImpeachmentQuestão de ordem - suspeição do relator da Comissão de Impeachment
Questão de ordem - suspeição do relator da Comissão de ImpeachmentMiguel Rosario
 
Dicintai alloh dan hamba nya
Dicintai alloh dan hamba nyaDicintai alloh dan hamba nya
Dicintai alloh dan hamba nyaYusuf Santoso
 
Kudavi 2.29.2016
Kudavi 2.29.2016Kudavi 2.29.2016
Kudavi 2.29.2016Tom Currier
 
Extensive sampling of basidiomycete genomes demonstrates inadequacy of the wh...
Extensive sampling of basidiomycete genomes demonstrates inadequacy of the wh...Extensive sampling of basidiomycete genomes demonstrates inadequacy of the wh...
Extensive sampling of basidiomycete genomes demonstrates inadequacy of the wh...Gomez García
 
Online branding for schools
Online branding for schoolsOnline branding for schools
Online branding for schoolsRather Inventive
 
Harnessing the Motivation Wave
Harnessing the Motivation WaveHarnessing the Motivation Wave
Harnessing the Motivation WaveAngad Singh
 
Insights and opportunities
Insights and opportunitiesInsights and opportunities
Insights and opportunitiesKompella Kashyap
 
Tek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJSTek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJSPablo Godel
 
Engagor introduction pitch
Engagor introduction pitchEngagor introduction pitch
Engagor introduction pitchDimitri Callens
 

Andere mochten auch (19)

Oap
OapOap
Oap
 
Denúncia da Lava Jato contra João Santana
Denúncia da Lava Jato contra João SantanaDenúncia da Lava Jato contra João Santana
Denúncia da Lava Jato contra João Santana
 
Логистика на аутсорс: гибкость в период нестабильности IForum2014
Логистика на аутсорс: гибкость в период нестабильности IForum2014Логистика на аутсорс: гибкость в период нестабильности IForum2014
Логистика на аутсорс: гибкость в период нестабильности IForum2014
 
Croatian Govt, the most communicative government in the world?
Croatian Govt, the most communicative government in the world?Croatian Govt, the most communicative government in the world?
Croatian Govt, the most communicative government in the world?
 
Questão de ordem - suspeição do relator da Comissão de Impeachment
Questão de ordem - suspeição do relator da Comissão de ImpeachmentQuestão de ordem - suspeição do relator da Comissão de Impeachment
Questão de ordem - suspeição do relator da Comissão de Impeachment
 
Dicintai alloh dan hamba nya
Dicintai alloh dan hamba nyaDicintai alloh dan hamba nya
Dicintai alloh dan hamba nya
 
Notam 30 07-15
Notam 30 07-15Notam 30 07-15
Notam 30 07-15
 
Assets models seminar
Assets models seminarAssets models seminar
Assets models seminar
 
Kudavi 2.29.2016
Kudavi 2.29.2016Kudavi 2.29.2016
Kudavi 2.29.2016
 
Extensive sampling of basidiomycete genomes demonstrates inadequacy of the wh...
Extensive sampling of basidiomycete genomes demonstrates inadequacy of the wh...Extensive sampling of basidiomycete genomes demonstrates inadequacy of the wh...
Extensive sampling of basidiomycete genomes demonstrates inadequacy of the wh...
 
Oap
OapOap
Oap
 
Como ler a bíblia
Como ler a bíbliaComo ler a bíblia
Como ler a bíblia
 
Online branding for schools
Online branding for schoolsOnline branding for schools
Online branding for schools
 
Harnessing the Motivation Wave
Harnessing the Motivation WaveHarnessing the Motivation Wave
Harnessing the Motivation Wave
 
Insights and opportunities
Insights and opportunitiesInsights and opportunities
Insights and opportunities
 
Tek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJSTek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJS
 
Homes
HomesHomes
Homes
 
Engagor introduction pitch
Engagor introduction pitchEngagor introduction pitch
Engagor introduction pitch
 
02_07_WH_ChrisWalker
02_07_WH_ChrisWalker02_07_WH_ChrisWalker
02_07_WH_ChrisWalker
 

Kürzlich hochgeladen

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 

Kürzlich hochgeladen (20)

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 

Java Dating - JSR 310 Lightning Talk

  • 1. LJC/JCP Committee Java Dating By James Gough Thursday, 14 July 2011
  • 2. LJC/JCP • Who am I? • What is the LJC/JCP? • Why get involved? Thursday, 14 July 2011
  • 3. Who am I? • James Gough • jpgough@gmail.com • Twitter: goughjam • Java developer for 8 years, 4 years industry experience • Work at a large investment bank developing Flex and Java • Run my own company in spare time developing iOS applications 3 Thursday, 14 July 2011
  • 4. LJC/JCP • LJC recently elected onto the JCP committee • JCP (Java Community Process) • The JCP is the mechanism for developing standard technical specifications for the Java technology • Interested? Ben Evans @kittylst on twitter, or find me at the bar on Tuesday 4 Thursday, 14 July 2011
  • 5. Why get involved? • Chance to have a say • Discover more about Java and the inner workings • Get involved on projects and contribute to Java directly • Offered to do a lightning talk • Coming soon: Java memory pub 5 Thursday, 14 July 2011
  • 6. Dates? • The thing that's bothering me at the moment is dating, there’s several things to be aware of: • Choosing a good restaurant • What to wear • .... 6 Thursday, 14 July 2011
  • 7. Java Dates • Java Date and Calendar • Joda Time • JSR-310 7 Thursday, 14 July 2011
  • 8. Java Date • Java Date has been in the language since January 23, 1996 • Many good discussions about what’s wrong with dates • Mutability • Date is a DateTime, but there are other classes for SQL • No Timezones • Not easy to use 8 Thursday, 14 July 2011
  • 9. Calendar • Still mutable • Can’t format a date directly 9 Thursday, 14 July 2011
  • 10. 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); 10 Thursday, 14 July 2011
  • 11. 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); 11 Thursday, 14 July 2011
  • 12. Joda Time • Instant • Moment in time, represented by DateTime. DateTime is immutable • Interval • An interval of time from one instant to another. Both end points have same Chronology and TimeZone • Duration • Duration of time measured in milliseconds. No timezone of chronology applies 12 Thursday, 14 July 2011
  • 13. Joda Time • Period • A period of time defined in terms of fields (e.g. +1 month) • Chronology • A calculation engine supporting complex calendar rules • In most this can be ignored, important to the internal design, but not to the standard user using ISOChronology • Timezones • DateTimeZone zone = DateTimeZone.forID ("Europe/London"); 13 Thursday, 14 July 2011
  • 14. JSR-310 • Human/Machine Timelines • Requirement to have a separation of concerns between human and machine timelines • DateTime is better thought of as a LocalDateTime and a timezone • Pluggable Chronology • Restrict DateTime classes to a single calendar system • Nulls • Null means 0 in most cases, ouch! 14 Thursday, 14 July 2011
  • 15. Getting Involved • ThreeTen is now on GitHub • Open project that can be contributed to • A few pull requests have been made since moving to GitHub • Accept the legal agreement • Mailing List: threeten- develop@lists.sourceforge.net 15 Thursday, 14 July 2011
  • 16. Contact • James Gough • jpgough@gmail.com • Twitter: goughjam 3 16 Thursday, 14 July 2011