Java 8 – ZonedDateTime examples
Few Java 8 java.time.ZonedDateTime examples to show you how to convert a time zone between different countries. The LocalDateTime has no time zone; to convert the LocalDateTime to ZonedDateTime, we…
Favourite tutorials for developers
Core Java is the fundamental form of Java. We use it in all Java platforms and technologies. Without going through core Java, it is impossible to advance to advanced Java. Unlike core Java, advanced Java is a specialization of the core Java in some particular domain, such as database handling, networking, and the web.
Few Java 8 java.time.ZonedDateTime examples to show you how to convert a time zone between different countries. The LocalDateTime has no time zone; to convert the LocalDateTime to ZonedDateTime, we…
In this tutorial, we will show you few examples (ZonedDateTime (Java 8), Date, Calendar and Joda Time) to convert a date and time between different time zones. For time zone,…
Few examples to convert classic Date to Java Time dates and vice versa: Convert java.util.Date to java.time.LocalDate, Convert java.util.Date to java.time.LocalDateTime, Convert java.util.Date to java.time.ZonedDateTime. The java.util.Date has no concept…
Java 8 examples to show you how to convert from Instant to ZonedDateTime. Example to convert a Instant UTC+0 to a Japan ZonedDateTime UTC+9. Convert the Japan ZonedDateTime UTC+9 back…
Java 8 examples to show you how to convert from Instant to LocalDateTime and vice versa. The java.time.LocalDateTime has no concept of time zone, just provide a zero offset UTC+0.
Few examples to show you how to use Java 8 Duration, Period and ChronoUnit objects to find out the difference between dates. Duration – Measures time in seconds and nanoseconds.…
In this tutorial, we will show you how to convert a String to java.util.Date. Many Java beginners are stuck in the Date conversion, hope this summary guide will helps you…
This article shows few Java examples to get the current date time or timestamp in Java. (Updated with Java 8): 1 - uses java.sql.Timestamp to get the current timestamp and…
In this tutorial, we will show you how to get the current date time from the new Java 8 java.time.* like Localdate, LocalTime, LocalDateTime, ZonedDateTime, Instant and also the legacy…
In Java 8, Stream cannot be reused, once it is consumed or used, the stream will be closed. If we reuse the stream it will throw an IllegalStateException, saying “stream…