public static final class DatatypeCoder.RawDateTimeStruct
extends java.lang.Object
Fractions are sub-second precision in 100 microseconds.
We cannot simply pass millis to the database, because Firebird stores timestamp in format (citing Ann W. Harrison):
"[timestamp is] stored a two long words, one representing the number of days since 17 Nov 1858 and one representing number of 100 nano-seconds since midnight" (NOTE: It is actually 100 microseconds!)
Modifier and Type | Field and Description |
---|---|
int |
day |
int |
fractions |
int |
hour |
int |
minute |
int |
month |
int |
second |
int |
year |
Constructor and Description |
---|
RawDateTimeStruct() |
RawDateTimeStruct(DatatypeCoder.RawDateTimeStruct raw) |
RawDateTimeStruct(int encodedDate,
boolean hasDate,
int encodedTime,
boolean hasTime)
Initializes a raw date/time value from encoded time and/or date integers.
|
Modifier and Type | Method and Description |
---|---|
int |
getEncodedDate()
Encodes the date as used by Firebird (Modified Julian Date, or number of days since 17 November 1858).
|
int |
getEncodedTime()
Encodes the time as used by Firebird (fractions (100 milliseconds) in a day).
|
int |
getFractionsAsNanos() |
void |
setFractionsFromNanos(long nanos)
Sets the sub-second fraction (100 microseconds) from a nanosecond value.
|
public int year
public int month
public int day
public int hour
public int minute
public int second
public int fractions
public RawDateTimeStruct()
public RawDateTimeStruct(int encodedDate, boolean hasDate, int encodedTime, boolean hasTime)
encodedDate
- Encoded date (Modified Julian Date)hasDate
- If date should be decoded (set false
for a time-only value)encodedTime
- Encoded time (fractions in day)hasTime
- If time should be decoded (set false
for a date-only value)public RawDateTimeStruct(DatatypeCoder.RawDateTimeStruct raw)
public int getFractionsAsNanos()
public void setFractionsFromNanos(long nanos)
nanos
- Sub-second nanosecondspublic int getEncodedDate()
public int getEncodedTime()
Copyright © 2001-2023 Jaybird (Firebird JDBC/JCA) team. All rights reserved.