Back to blog
29 Dec 2025
3 min read

Java Instant date type for events

Using Instant to represent event time across timezones

When to use Java Instant date type

If you want to represent an event, it’s a good idea to use the Instant date type. Say we have an event taking place in Brisbane, Australia at 6:00 PM. We want to invite people in different timezones. Let’s assume we know the timezones of those other people. One is in Auckland, New Zealand and the other is in Paris, France. The first step is to record our event time as a local date time. Then we will convert it to an Instant, which represents a specific moment in time independent of timezone.

In the example above, we create a LocalDateTime for the meeting time, then convert it to an Instant by specifying the Brisbane timezone. Once we have the meeting Instant based on the creator’s timezone, we can persist it in the database. We can then display the meeting date and time for other people using their timezone IDs.

Notice how the same Instant automatically adjusts to show the correct local time for each timezone.

Why use Instant?

Instant is timezone-agnostic and represents a point on the timeline in UTC. This makes it perfect for:

  • Storing event times in databases
  • Coordinating events across multiple timezones
  • Ensuring consistency regardless of server or user timezone

When NOT to use Instant

Don’t use Instant when you need to represent:

  • A date without a specific time (use LocalDate)
  • A time without a specific timezone (use LocalDateTime)
  • Recurring events that should respect local time changes (like “9 AM every day” which should remain 9 AM even during daylight saving changes)

Dates are one of those things that can cause pain if you get them wrong in your application design. Always decide ahead of time which date types make sense for what you’re trying to represent.