- All Implemented Interfaces:
Adapter.Contract<OffsetTime>
,Adapter.Contract.Scalar<OffsetTime>
,Datetime.TimeTZ<OffsetTime>
- Enclosing interface:
Datetime.TimeTZ<T>
OffsetTime
.
While PostgreSQL allows 24:00:00 as a valid time, Java's rules
max out at the preceding nanosecond. That is still a value that
can be distinguished, because PostgreSQL's time resolution is only
to microseconds, so the PostgreSQL 24:00:00 value will be mapped
to a value whose LocalTime
component matches (with
equals
) AsLocalTime.HOUR24
,
which is really one nanosecond shy of 24 hours.
In the other direction, nanoseconds will be rounded to microseconds,
so any value within the half-microsecond preceding HOUR24
will become the PostgreSQL 24:00:00 value.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.postgresql.pljava.Adapter.Contract
Adapter.Contract.Array<T,
E, A extends Adapter<E, ?>>, Adapter.Contract.Scalar<T> Nested classes/interfaces inherited from interface org.postgresql.pljava.adt.Datetime.TimeTZ
Datetime.TimeTZ.AsOffsetTime, Datetime.TimeTZ.Modifier<T>
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionconstruct
(long microsecondsSinceMidnight, int secondsWestOfPrimeMeridian) Constructs a representation T from the components of the PostgreSQL data type.<T> T
store
(OffsetTime t, Datetime.TimeTZ<T> f)
-
Field Details
-
INSTANCE
-
-
Method Details
-
construct
Description copied from interface:Datetime.TimeTZ
Constructs a representation T from the components of the PostgreSQL data type.The first argument represents microseconds since midnight, nonnegative and not exceeding
USECS_PER_DAY
, and the second is a time zone offset expressed in seconds, positive for locations west of the prime meridian.It should be noted that other common conventions, such as ISO 8601 and
java.time.ZoneOffset
, use positive offsets for locations east of the prime meridian, requiring a sign flip.Also noteworthy, as with
Time
, is that the first argument may exactly equalUSECS_PER_DAY
; 24:00:00 is a valid value to PostgreSQL. That may need extra attention if the representation to be constructed doesn't allow that.- Specified by:
construct
in interfaceDatetime.TimeTZ<OffsetTime>
- Parameters:
microsecondsSinceMidnight
- the time of day, in the zone indicated by the second argumentsecondsWestOfPrimeMeridian
- note that the sign of this time zone offset will be the opposite of that used in other common systems using positive values for offsets east of the prime meridian.
-
store
-