# OffsetDateTime

OffsetDateTime is an immutable Java class representing an ISO-8601 date-time with a UTC/Greenwich offset, stored to nanosecond precision.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## CodeSOD: The Date and Time and Time

DevFeed: [CodeSOD: The Date and Time and Time](<https://devfeed.tech/articles/codesod-the-date-and-time-and-time-64780.md>)

Original publisher: [Read original article](<https://thedailywtf.com/articles/the-date-and-time-and-time>)

Author: Remy Porter

Published: 2026-10-05T06:30:00Z

Content type: article

Language: en

Sources: [The Daily WTF](<https://devfeed.tech/sources/the-daily-wtf.md>)

Topics: [versioning](<https://devfeed.tech/topics/versioning.md>), [LocalDate](<https://devfeed.tech/topics/localdate.md>), [OffsetDateTime](<https://devfeed.tech/topics/offsetdatetime.md>), [C time functions](<https://devfeed.tech/topics/c-time-functions.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [codesod](<https://devfeed.tech/tags/codesod.md>), [java](<https://devfeed.tech/tags/java.md>), [legacy](<https://devfeed.tech/tags/legacy.md>), [software](<https://devfeed.tech/tags/software.md>), [time](<https://devfeed.tech/tags/time.md>)

### AI overview

A brief CodeSOD commentary examines legacy Java code that retrieves the current time by converting between Date and Timestamp objects. It calls the extra conversions unnecessary and describes the code as home-grown ugliness.

### Source excerpt

Today's anonymous submitter sends us some legacy Java code. The task is this: check what time it is. And fortunately, even in the older Java datetime libraries that were terrible, this was an easy task. You just needed to do something like new Date(), which constructs a date time object set to the current time. getTime() picks off just the time portion. Or, you could do this. Timestamp current = new Timestamp(new Date().getTime()); Date date = new Date(current.getTime()); This creates a date, picks the time off, populates a timestamp, gets the time from the timestamp, and constructs a new date object. The old Java date classes were awful, but they never needed you to do this. This is entirely home grown ugliness. [Advertisement] Utilize BuildMaster to release your software with confidence, at the pace your business demands. Download today!

## How to map the Oracle TIMESTAMP WITH TIME ZONE with JPA

DevFeed: [How to map the Oracle TIMESTAMP WITH TIME ZONE with JPA](<https://devfeed.tech/articles/how-to-map-the-oracle-timestamp-with-time-zone-with-jpa-21987.md>)

Original publisher: [Read original article](<https://vladmihalcea.com/oracle-timestamp-with-time-zone-jpa/>)

Author: vladmihalcea

Published: 2025-03-18T16:21:37Z

Content type: tutorial

Language: en

Sources: [Vlad Mihalcea](<https://devfeed.tech/sources/vlad-mihalcea.md>)

Topics: [jpa](<https://devfeed.tech/topics/jpa.md>), [Oracle Database](<https://devfeed.tech/topics/oracle-database.md>), [OffsetDateTime](<https://devfeed.tech/topics/offsetdatetime.md>), [data type](<https://devfeed.tech/topics/data-type.md>)

Tags: [allows](<https://devfeed.tech/tags/allows.md>), [article](<https://devfeed.tech/tags/article.md>), [column](<https://devfeed.tech/tags/column.md>), [explain](<https://devfeed.tech/tags/explain.md>), [hibernate](<https://devfeed.tech/tags/hibernate.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [i](<https://devfeed.tech/tags/i.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [jpa](<https://devfeed.tech/tags/jpa.md>), [map](<https://devfeed.tech/tags/map.md>), [mapping](<https://devfeed.tech/tags/mapping.md>), [offsetdatetime](<https://devfeed.tech/tags/offsetdatetime.md>), [oracle](<https://devfeed.tech/tags/oracle.md>), [store](<https://devfeed.tech/tags/store.md>), [this](<https://devfeed.tech/tags/this.md>), [time](<https://devfeed.tech/tags/time.md>), [timezone](<https://devfeed.tech/tags/timezone.md>), [type](<https://devfeed.tech/tags/type.md>), [types](<https://devfeed.tech/tags/types.md>), [values](<https://devfeed.tech/tags/values.md>), [with](<https://devfeed.tech/tags/with.md>), [zoneddatetime](<https://devfeed.tech/tags/zoneddatetime.md>)

### AI overview

Oracle TIMESTAMP WITH TIME ZONE stores fractional seconds plus time zone region or offset, unlike Oracle DATE and TIMESTAMP, which do not store time zone information. The article says it can map to Java ZonedDateTime or OffsetDateTime. For a column storing a region, the excerpt shows a ZonedDateTime mapping and explains that Hibernate's default handling reads the value as an OffsetDateTime; explicitly selecting the appropriate Hibernate type is needed to retain the region when fetching. The excerpt ends during the fetch example and does not provide the complete mapping code or OffsetDateTime details.

### Source excerpt

Introduction In this article, I'm going to explain how to map the Oracle TIMESTAMP WITH TIME ZONE with JPA and Hibernate. While the DATE and TIMESTAMP column types are suitable for mapping the LocalDateTime, the TIMESTAMP WITH TIME ZONE column type allows us to map both the ZonedDateTime and OffsetDateTime. Oracle TIMESTAMP WITH TIME ZONE Traditionally, Oracle provided the DATE and TIMESTAMP column types to store timestamp values. The difference between the DATE and TIMESTAMP types is that the TIMESTAMP column type allows us to store fractional seconds while the DATE type... Read More The post How to map the Oracle TIMESTAMP WITH TIME ZONE with JPA appeared first on Vlad Mihalcea.