ZonedDateTime

In this lesson, we will explore the ZonedDateTime class and its methods.

The ZonedDateTime class represents a date and a time with time zone information. While creating an instance of ZonedDateTime, we need to provide a ZoneId. The ZoneId is an identifier used to represent different zones. Before we proceed towards ZonedDateTime, let’s look at ZoneId briefly.

The below example shows how to get a ZoneId for a given Zone.

Get hands-on with 1200+ tech skills courses.