Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

344
Views
java.time.Instant.atZone(...) far in the past return crazy values

I detect the following output when converting an Instant that is far in the past to a ZonedDateTime.

Code as Unit-Test:

   @Test
public void testParseDate() {
    Instant instant = Instant.parse("0000-12-30T07:00:00Z");
    System.out.println(instant);
    System.out.println(instant.atZone(ZoneId.of("Europe/Berlin")));

    instant = Instant.parse("1800-12-30T07:00:00Z");
    System.out.println("---------------------------------");
    System.out.println(instant);
    System.out.println(instant.atZone(ZoneId.of("Europe/Berlin")));

    instant = Instant.parse("1900-12-30T07:00:00Z");
    System.out.println("---------------------------------");
    System.out.println(instant);
    System.out.println(instant.atZone(ZoneId.of("Europe/Berlin")));
}

Output:

0000-12-30T07:00:00Z
0000-12-30T07:53:28+00:53:28[Europe/Berlin]
---------------------------------
1800-12-30T07:00:00Z
1800-12-30T07:53:28+00:53:28[Europe/Berlin]
---------------------------------
1900-12-30T07:00:00Z
1900-12-30T08:00+01:00[Europe/Berlin]

In the first two outputs the time is 07:53:28+00:53:28 and the last output is 08:00+01:00[Europe/Berlin]. Maybe the root cause is that the time zone stuff doesn't yet exists in the years of the first two examples, but the offset of +00:53:28 is really strange. Any idea where this offset "+00:53:28" comes from?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Because history.

On April 1st, 1893, the time zone was adjusted from Local Mean Time (LMT), a local time zone (which was common at that time), to Central European Time (CET), adjusting the clock by 6 minutes and 32 seconds.

Timezones are regularly changed due to political decisions, but those strange amounts like 6 minutes and 32 seconds are often the result of moving from a local mean time to a standardized time.

Many known historical changes are found at timeanddate.com, and Berlin specifically at https://www.timeanddate.com/time/zone/germany/berlin.

over 4 years ago · Santiago Trujillo Report

0

Timezones, Daylight Saving, and all those annoying and fancy features, did not exist at the beginning of the 20th century.

There were many "variations" of the time, like the infamous Dutch Time which was about 19 minutes ahead of UTC, mostly based on the clock of a tower which was simply that amount of time ahead.

I don't know exactly where the time difference comes from in the case of Germany and Berlin, but it's a known offset (likely based on similar reasons as the Dutch Time).

You can see how it has evolved over time.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!