SlideShare a Scribd company logo
1 of 10
Download to read offline
Java 
8 
Date 
& 
Time 
API 
Speaker: 
Oleg 
Tsal-­‐Tsalko(@tsaltsol)
About 
me 
Oleg 
Tsal-­‐Tsalko 
Lead 
So:ware 
Engineer 
at 
EPAM 
Systems. 
Speaker, 
acEve 
member 
of 
Kiev 
JUG. 
ParEcipate 
in 
different 
educaEonal 
iniEaEves 
and 
JCP/AdoptJSR 
programs.
Benefits 
• JSR-­‐310: 
New 
Date 
& 
Time 
API 
• Replaces 
old 
ambiguous 
java.uEl.Date, 
Calendar, 
TimeZone, 
DateFormat 
classes 
• More 
fluent/simple/clean 
API 
• Immutable 
classes 
• Using 
Java8 
features 
including 
lambdas 
• Precise 
separaEon 
of 
concepts
Range 
of 
types 
• LocalDate 
– 
a 
date 
only 
• LocalTime 
– 
a 
Eme 
only 
• LocalDateTime 
– 
date 
with 
Eme 
• ZonedDateTime 
– 
date 
with 
Eme 
in 
Eme 
zone 
• Period 
-­‐ 
date-­‐based 
amount 
of 
Eme 
• Dura>on 
-­‐ 
Eme-­‐based 
amount 
of 
Eme 
• And 
more…
TimeZones 
If 
you 
can 
avoid 
using 
TimeZones 
– 
do 
it! 
If 
not 
– 
use 
ZonedDateAndTime!
TimeZone 
classes 
in 
Java 
8 
• ZoneId 
– 
replacement 
for 
TimeZone 
class 
(e.g. 
“Europe/London”, 
“Europe/Kiev”) 
• ZoneOffset 
– 
represenEng 
offset 
from 
UTC 
Eme 
• ZoneRules 
– 
behind 
the 
scenes 
class 
which 
defines 
Eme 
zone 
rules 
• ZonedDateTime 
– 
main 
date/Eme 
class 
which 
is 
aware 
of 
Eme 
zones
Power 
of 
abstracEon 
New 
API 
is 
very 
flexible 
because 
it 
based 
on 
number 
of 
abstracEons 
at 
it’s 
boeom: 
• Temporal 
– 
parent 
class 
for 
all 
date/Eme 
objects 
which 
defines 
mutaEon 
operaEon 
for 
them 
such 
as 
plus/ 
minus/with 
• TemporalAdjuster 
– 
funcEonal 
interface 
which 
responsible 
for 
mutaEng 
Temporal 
objects 
• TemporalField 
– 
represents 
parts/fields 
of 
date/Eme 
objects 
such 
as 
(DAY_OF_WEEK, 
MONTH, 
etc.) 
• TemporalUnit 
– 
represents 
type 
of 
date/Eme 
values 
such 
as 
(MINUTES, 
DAYS, 
YEARS, 
etc.) 
• TemporalAmount 
– 
class 
which 
represents 
amount 
of 
Eme
Links 
• heps://today.java.net/pub/a/today/2008/09/18/ 
jsr-­‐310-­‐new-­‐java-­‐date-­‐Eme-­‐api.html 
• hep://blog.joda.org/2009/11/why-­‐jsr-­‐310-­‐isn-­‐ 
joda-­‐Eme_4941.html 
• heps://blogs.oracle.com/thejavatutorials/entry/ 
javaone_2013_jdk_8_date 
• hep://vimeo.com/87157763 
• hep://parleys.com/play/ 
52508380e4b0c4f11ec57665/about 
• hep://www.oracle.com/events/us/en/java8/ 
index.html
Thank 
you! 
Oleg 
Tsal-­‐Tsalko 
Email: 
oleg.tsalko@gmail.com 
Twieer: 
@tsaltsol

More Related Content

Similar to Java 8 date & time javaday2014

SFDC Introduction to Apex
SFDC Introduction to ApexSFDC Introduction to Apex
SFDC Introduction to ApexSujit Kumar
 
Complete PPT about the Java lokesh kept it
Complete PPT about the Java lokesh kept itComplete PPT about the Java lokesh kept it
Complete PPT about the Java lokesh kept itlokeshpappaka10
 
A Quick peek @ New Date & Time API of Java 8
A Quick peek @ New Date & Time API of Java 8A Quick peek @ New Date & Time API of Java 8
A Quick peek @ New Date & Time API of Java 8Buddha Jyothiprasad
 
Journey towards serverless infrastructure
Journey towards serverless infrastructureJourney towards serverless infrastructure
Journey towards serverless infrastructureVille Seppänen
 
Improved Developer Productivity In JDK8
Improved Developer Productivity In JDK8Improved Developer Productivity In JDK8
Improved Developer Productivity In JDK8Simon Ritter
 
Eliminating the Pauses in your Java Application
Eliminating the Pauses in your Java ApplicationEliminating the Pauses in your Java Application
Eliminating the Pauses in your Java ApplicationMark Stoodley
 
learn JAVA at ASIT with a placement assistance.
learn JAVA at ASIT with a placement assistance.learn JAVA at ASIT with a placement assistance.
learn JAVA at ASIT with a placement assistance.ASIT Education
 
Automation of Deep learning training with AWS Step Functions
Automation of Deep learning training with AWS Step FunctionsAutomation of Deep learning training with AWS Step Functions
Automation of Deep learning training with AWS Step Functionsmizugokoro
 
Introduction to Java 8 java.time
Introduction to Java 8 java.timeIntroduction to Java 8 java.time
Introduction to Java 8 java.timeJim Gough
 
Dev112 let's calendar that
Dev112   let's calendar thatDev112   let's calendar that
Dev112 let's calendar thatHoward Greenberg
 
What's new in Solr 5.0
What's new in Solr 5.0What's new in Solr 5.0
What's new in Solr 5.0Anshum Gupta
 

Similar to Java 8 date & time javaday2014 (20)

Java 8 date & time
Java 8 date & timeJava 8 date & time
Java 8 date & time
 
Fun times with ruby
Fun times with rubyFun times with ruby
Fun times with ruby
 
Java 8 Date-Time API
Java 8 Date-Time APIJava 8 Date-Time API
Java 8 Date-Time API
 
Java 8
Java 8Java 8
Java 8
 
SFDC Introduction to Apex
SFDC Introduction to ApexSFDC Introduction to Apex
SFDC Introduction to Apex
 
Complete PPT about the Java lokesh kept it
Complete PPT about the Java lokesh kept itComplete PPT about the Java lokesh kept it
Complete PPT about the Java lokesh kept it
 
A Quick peek @ New Date & Time API of Java 8
A Quick peek @ New Date & Time API of Java 8A Quick peek @ New Date & Time API of Java 8
A Quick peek @ New Date & Time API of Java 8
 
Java utility classes
Java utility classesJava utility classes
Java utility classes
 
Journey towards serverless infrastructure
Journey towards serverless infrastructureJourney towards serverless infrastructure
Journey towards serverless infrastructure
 
Improved Developer Productivity In JDK8
Improved Developer Productivity In JDK8Improved Developer Productivity In JDK8
Improved Developer Productivity In JDK8
 
Eliminating the Pauses in your Java Application
Eliminating the Pauses in your Java ApplicationEliminating the Pauses in your Java Application
Eliminating the Pauses in your Java Application
 
learn JAVA at ASIT with a placement assistance.
learn JAVA at ASIT with a placement assistance.learn JAVA at ASIT with a placement assistance.
learn JAVA at ASIT with a placement assistance.
 
Eclipse UOMo
Eclipse UOMoEclipse UOMo
Eclipse UOMo
 
Automation of Deep learning training with AWS Step Functions
Automation of Deep learning training with AWS Step FunctionsAutomation of Deep learning training with AWS Step Functions
Automation of Deep learning training with AWS Step Functions
 
Introduction to Java 8 java.time
Introduction to Java 8 java.timeIntroduction to Java 8 java.time
Introduction to Java 8 java.time
 
What’s new in java 8
What’s new in java 8What’s new in java 8
What’s new in java 8
 
JavaOne 2011 Recap
JavaOne 2011 RecapJavaOne 2011 Recap
JavaOne 2011 Recap
 
Dev112 let's calendar that
Dev112   let's calendar thatDev112   let's calendar that
Dev112 let's calendar that
 
Elixir
ElixirElixir
Elixir
 
What's new in Solr 5.0
What's new in Solr 5.0What's new in Solr 5.0
What's new in Solr 5.0
 

More from Oleg Tsal-Tsalko

Developer on a mission (Devoxx UA 2021)
Developer on a mission (Devoxx UA 2021)Developer on a mission (Devoxx UA 2021)
Developer on a mission (Devoxx UA 2021)Oleg Tsal-Tsalko
 
From Streams to Reactive Streams
From Streams to Reactive StreamsFrom Streams to Reactive Streams
From Streams to Reactive StreamsOleg Tsal-Tsalko
 
JUG UA AdoptJSR participation
JUG UA AdoptJSR participationJUG UA AdoptJSR participation
JUG UA AdoptJSR participationOleg Tsal-Tsalko
 
Develop modern apps using Spring ecosystem at time of BigData
Develop modern apps using Spring ecosystem at time of BigData Develop modern apps using Spring ecosystem at time of BigData
Develop modern apps using Spring ecosystem at time of BigData Oleg Tsal-Tsalko
 
Enterprise Integration Patterns
Enterprise Integration PatternsEnterprise Integration Patterns
Enterprise Integration PatternsOleg Tsal-Tsalko
 
Distributed systems and scalability rules
Distributed systems and scalability rulesDistributed systems and scalability rules
Distributed systems and scalability rulesOleg Tsal-Tsalko
 
JUG involvment in JCP and AdopJSR program
JUG involvment in JCP and AdopJSR programJUG involvment in JCP and AdopJSR program
JUG involvment in JCP and AdopJSR programOleg Tsal-Tsalko
 

More from Oleg Tsal-Tsalko (13)

Developer on a mission (Devoxx UA 2021)
Developer on a mission (Devoxx UA 2021)Developer on a mission (Devoxx UA 2021)
Developer on a mission (Devoxx UA 2021)
 
Developer on a mission
Developer on a missionDeveloper on a mission
Developer on a mission
 
From Streams to Reactive Streams
From Streams to Reactive StreamsFrom Streams to Reactive Streams
From Streams to Reactive Streams
 
Java 9 Jigsaw HackDay
Java 9 Jigsaw HackDayJava 9 Jigsaw HackDay
Java 9 Jigsaw HackDay
 
JUG UA AdoptJSR participation
JUG UA AdoptJSR participationJUG UA AdoptJSR participation
JUG UA AdoptJSR participation
 
Develop modern apps using Spring ecosystem at time of BigData
Develop modern apps using Spring ecosystem at time of BigData Develop modern apps using Spring ecosystem at time of BigData
Develop modern apps using Spring ecosystem at time of BigData
 
Java 8 features
Java 8 featuresJava 8 features
Java 8 features
 
Lambdas HOL
Lambdas HOLLambdas HOL
Lambdas HOL
 
Get ready for spring 4
Get ready for spring 4Get ready for spring 4
Get ready for spring 4
 
Enterprise Integration Patterns
Enterprise Integration PatternsEnterprise Integration Patterns
Enterprise Integration Patterns
 
Distributed systems and scalability rules
Distributed systems and scalability rulesDistributed systems and scalability rules
Distributed systems and scalability rules
 
Next stop: Spring 4
Next stop: Spring 4Next stop: Spring 4
Next stop: Spring 4
 
JUG involvment in JCP and AdopJSR program
JUG involvment in JCP and AdopJSR programJUG involvment in JCP and AdopJSR program
JUG involvment in JCP and AdopJSR program
 

Recently uploaded

Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 

Recently uploaded (20)

★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 

Java 8 date & time javaday2014

  • 1. Java 8 Date & Time API Speaker: Oleg Tsal-­‐Tsalko(@tsaltsol)
  • 2. About me Oleg Tsal-­‐Tsalko Lead So:ware Engineer at EPAM Systems. Speaker, acEve member of Kiev JUG. ParEcipate in different educaEonal iniEaEves and JCP/AdoptJSR programs.
  • 3. Benefits • JSR-­‐310: New Date & Time API • Replaces old ambiguous java.uEl.Date, Calendar, TimeZone, DateFormat classes • More fluent/simple/clean API • Immutable classes • Using Java8 features including lambdas • Precise separaEon of concepts
  • 4. Range of types • LocalDate – a date only • LocalTime – a Eme only • LocalDateTime – date with Eme • ZonedDateTime – date with Eme in Eme zone • Period -­‐ date-­‐based amount of Eme • Dura>on -­‐ Eme-­‐based amount of Eme • And more…
  • 5. TimeZones If you can avoid using TimeZones – do it! If not – use ZonedDateAndTime!
  • 6. TimeZone classes in Java 8 • ZoneId – replacement for TimeZone class (e.g. “Europe/London”, “Europe/Kiev”) • ZoneOffset – represenEng offset from UTC Eme • ZoneRules – behind the scenes class which defines Eme zone rules • ZonedDateTime – main date/Eme class which is aware of Eme zones
  • 7. Power of abstracEon New API is very flexible because it based on number of abstracEons at it’s boeom: • Temporal – parent class for all date/Eme objects which defines mutaEon operaEon for them such as plus/ minus/with • TemporalAdjuster – funcEonal interface which responsible for mutaEng Temporal objects • TemporalField – represents parts/fields of date/Eme objects such as (DAY_OF_WEEK, MONTH, etc.) • TemporalUnit – represents type of date/Eme values such as (MINUTES, DAYS, YEARS, etc.) • TemporalAmount – class which represents amount of Eme
  • 8.
  • 9. Links • heps://today.java.net/pub/a/today/2008/09/18/ jsr-­‐310-­‐new-­‐java-­‐date-­‐Eme-­‐api.html • hep://blog.joda.org/2009/11/why-­‐jsr-­‐310-­‐isn-­‐ joda-­‐Eme_4941.html • heps://blogs.oracle.com/thejavatutorials/entry/ javaone_2013_jdk_8_date • hep://vimeo.com/87157763 • hep://parleys.com/play/ 52508380e4b0c4f11ec57665/about • hep://www.oracle.com/events/us/en/java8/ index.html
  • 10. Thank you! Oleg Tsal-­‐Tsalko Email: oleg.tsalko@gmail.com Twieer: @tsaltsol