Tag: Java Dates

Core Java

How to Handle Daylight Savings In Java

Introduction: Daylight Savings, often referred to as DST, is a practice of advancing the clocks during summer months to use the natural daylight a little longer. The clock is again adjusted backwards during fall to match the standard clock. The concept of Daylight Savings is used by many countries and therefore must be taken into […]

Be the First to comment. Read More
Core Java

OCA Java 8 Preparation : DateTimeFormatter

Introduction : DateTimeFormatter class belongs to java.time.format package. You can use it to format or parse the date or time or a datetime object. Remember for the sake of exam, it defines rules for both parsing and formatting. To instantiate a DateTimeFormatter, use any of the below ways : Calling the static ofLocalizedXXX() method, passing […]

Be the First to comment. Read More
Core Java

OCA Java 8 Preparation : Period

In continuation of this post covering the temporal classes – LocalDate, LocalTime and LocalDateTime, today we’ll be covering the Period class which is also on the OCA Java 8 Exam. Creating Period instances : Period class also belongs to java.time package. It represents a date-based amount of time in terms of years, months, and days […]

Be the First to comment. Read More
Core Java

OCA Java 8 Preparation : Date Time API

Below are the temporal classes that you are expected to know for your OCA Java 8 Certification Exam : java.time package : LocalDate : This class represents a date only in terms of date – based values(year, month, day). Time-zones aren’t handled. LocalTime : LocalTime represents only the time value(hours, minutes, seconds, nanoseconds ) within […]

Be the First to comment. Read More