Date value: a bit field with bits for the year, month, and day. Absolute day: the day number (0 means 1970-01-01).
| Modifier and Type | Field and Description |
|---|---|
| public static final int | EPOCH_DATE_VALUE
Date value for 1970-01-01. |
| pack-priv static final int[] | FRACTIONAL_SECONDS_TABLE
Multipliers for |
| private static volatile TimeZoneProvider | |
| public static final long | MAX_DATE_VALUE
Maximum possible date value. |
| public static final long | MILLIS_PER_DAY
The number of milliseconds per day. |
| public static final long | MIN_DATE_VALUE
Minimum possible date value. |
| public static final long | NANOS_PER_DAY
The number of nanoseconds per day. |
| public static final long | NANOS_PER_HOUR
The number of nanoseconds per hour. |
| public static final long | NANOS_PER_MINUTE
The number of nanoseconds per minute. |
| public static final long | NANOS_PER_SECOND
The number of nanoseconds per second. |
| private static final int[] | |
| public static final long | SECONDS_PER_DAY
The number of seconds per day. |
| public static final int | SHIFT_MONTH
The offset of month bits in date values. |
| public static final int | SHIFT_YEAR
The offset of year bits in date values. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static long | |
| public static long | Returns: the absolute daythe date value dateValue)Calculate the absolute day from an encoded date value. |
| public static long | Returns: the absolute daythe year year)Calculate the absolute day for a January, 1 of the specified year. |
| public static StringBuilder | Returns: the specified string builderthe target string builder builder, long the date value dateValue)Append a date to the string builder. |
| pack-priv static StringBuilder | Returns: the specified string builderstring builder to append to builder, int nanoseconds of second nanos)Append nanoseconds of time, if any. |
| public static StringBuilder | Returns: the specified string builderthe target string builder builder, long the time in nanoseconds nanos)Append a time to the string builder. |
| public static StringBuilder | Returns: the specified string builderthe target string builder builder, int the time zone offset in seconds tz)Append a time zone to the string builder. |
| public static long | Returns: scaled valuenanoseconds of day nanosOfDay, int fractional seconds precision scale, long the allowed range of values (0..range-1) range)Converts scale of nanoseconds. |
| public static ValueTimestampTimeZone | Returns: current timestampthe time zone timeZone)Returns current timestamp. |
| public static ValueTimestampTimeZone | Returns: current timestampthe time zone timeZone, Instant timestamp source, must be greater than or equal to
1970-01-01T00:00:00Z now)Returns current timestamp using the specified instant for its value. |
| public static long[] | Returns: array with date value and nanos of dayvalue to extract fields from value, CastDataProvider the cast information provider provider)Extracts date value and nanos of day from the specified value. |
| public static Value | Returns: new value with specified date value and nanos of dayoriginal value original, long date value for the returned value dateValue, long nanos of day for the returned value timeNanos)Creates a new date-time value with the same type as original value. |
| public static long | Returns: the date valuethe year year, int the month (1..12) month, int the day (1..31) day)Get the date value from a given date. |
| public static long | Returns: the date valuethe absolute day absoluteDay)Calculate the encoded date value from an absolute day. |
| public static long | Returns: the date valuethe year year, long the month, if out of range month and year will be normalized month, int the day of the month, if out of range it will be saturated day)Get the date value from a given denormalized date with possible out of range values of month and/or day. |
| public static long | Returns: the date valuethe seconds since 1970-01-01 localSeconds)Convert a local seconds to an encoded date. |
| public static int | Returns: the day (1..31)the date value x)Get the day of month from a date value. |
| public static long | Returns: the previous date valuethe date value dateValue)Return the previous date value. |
| public static int | Returns: day of weekthe date value dateValue, int first day of week, Monday as 1, Sunday as 7 or 0 firstDayOfWeek)Returns day of week. |
| public static int | Returns: the day of weekthe absolute day absoluteValue, int the first day of the week firstDayOfWeek)Get the day of the week from the absolute day value. |
| public static int | Returns: number of day in yearthe date value dateValue)Returns number of day in year. |
| public static int | Returns: number of days in the specified monththe year year, int the month month)Returns number of days in month. |
| public static long | Returns: seconds since epoch in UTCdate value dateValue, long nanoseconds since midnight timeNanos, int time zone offset in seconds offsetSeconds)Calculates the seconds since epoch for the specified date value, nanoseconds since midnight, and time zone offset. |
| public static int | Returns: ISO day of week, Monday as 1 to Sunday as 7the date value dateValue)Returns ISO day of week. |
| public static int | Returns: number of week in yearthe date value dateValue)Returns ISO number of week in year. |
| public static int | |
| public static int | Returns: day of week, Sunday as 1 to Monday as 7the date value dateValue)Returns day of week with Sunday as 1. |
| public static TimeZoneProvider | Returns: the time zone provider for the default time zoneGet the time zone provider for the default time zone. |
| public static int | Returns: number of week in yearthe date value dateValue, int first day of week, Monday as 1, Sunday as 7 or 0 firstDayOfWeek, int minimal days in first week of year minimalDaysInFirstWeek)Returns number of week in year. |
| public static int | Returns: week yearthe date value dateValue, int first day of week, Monday as 1, Sunday as 7 or 0 firstDayOfWeek, int minimal days in first week of year minimalDaysInFirstWeek)Returns week year. |
| public static long | Returns: absolute day of the first day in the week yearthe week year weekYear, int first day of week, Monday as 1, Sunday as 7 or 0 firstDayOfWeek, int minimal days in first week of year minimalDaysInFirstWeek)Get absolute day of the first day in the week year. |
| public static long | Returns: the next date valuethe date value dateValue)Return the next date value. |
| pack-priv static boolean | |
| public static boolean | Returns: true if it is validthe year year, int the month (January is 1) month, int the day (1 is the first of the month) day)Verify if the specified date is valid. |
| public static int | |
| public static long | Returns: the nanosecondsthe seconds since 1970-01-01 localSeconds)Convert a time in seconds in local time to the nanoseconds since midnight. |
| public static long | Returns: the nanos of day within a daythe nanoseconds (may be negative or larger than one day) nanos)Calculate the normalized nanos of day. |
| public static long | Returns: the date valuethe string to parse s, int the parse index start start, int the parse index end end)Parse a date string. |
| pack-priv static int | Returns: Parsed nanoseconds.String to parse. s, int Begin position at the string to read. start, int End position at the string to read. end)Parse nanoseconds. |
| public static Value | Returns: parsed timestring to parse s, CastDataProvider the cast information provider, or provider, boolean withTimeZone)nullParses time value from the specified string. |
| public static long | Returns: the time in nanosecondsthe string to parse s, int the parse index start start, int the parse index end end)Parse a time string. |
| public static Value | Returns: parsed timestampstring to parse s, CastDataProvider the cast information provider, may be provider, boolean withTimeZone)null for
Standard-compliant literalsParses timestamp value from the specified string. |
| public static void | resetCalendar()
Reset the cached calendar for default timezone, for example after changing the default timezone. |
| public static ValueTimestampTimeZone | Returns: timestamp with time zone with new offsetthe date value dateValue, long the nanoseconds since midnight timeNanos, int old offset oldOffset, int new offset newOffset)Moves timestamp with time zone to a new time zone. |
| public static String | Returns: time zone nametime zone offset in seconds offsetSeconds)Generates time zone name for the specified offset in seconds. |
| public static int |
| EPOCH_DATE_VALUE | back to summary |
|---|---|
| public static final int EPOCH_DATE_VALUE Date value for 1970-01-01. | |
| FRACTIONAL_SECONDS_TABLE | back to summary |
|---|---|
| pack-priv static final int[] FRACTIONAL_SECONDS_TABLE Multipliers for | |
| LOCAL | back to summary |
|---|---|
| private static volatile TimeZoneProvider LOCAL | |
| MAX_DATE_VALUE | back to summary |
|---|---|
| public static final long MAX_DATE_VALUE Maximum possible date value. | |
| MILLIS_PER_DAY | back to summary |
|---|---|
| public static final long MILLIS_PER_DAY The number of milliseconds per day. | |
| MIN_DATE_VALUE | back to summary |
|---|---|
| public static final long MIN_DATE_VALUE Minimum possible date value. | |
| NANOS_PER_DAY | back to summary |
|---|---|
| public static final long NANOS_PER_DAY The number of nanoseconds per day. | |
| NANOS_PER_HOUR | back to summary |
|---|---|
| public static final long NANOS_PER_HOUR The number of nanoseconds per hour. | |
| NANOS_PER_MINUTE | back to summary |
|---|---|
| public static final long NANOS_PER_MINUTE The number of nanoseconds per minute. | |
| NANOS_PER_SECOND | back to summary |
|---|---|
| public static final long NANOS_PER_SECOND The number of nanoseconds per second. | |
| NORMAL_DAYS_PER_MONTH | back to summary |
|---|---|
| private static final int[] NORMAL_DAYS_PER_MONTH | |
| SECONDS_PER_DAY | back to summary |
|---|---|
| public static final long SECONDS_PER_DAY The number of seconds per day. | |
| SHIFT_MONTH | back to summary |
|---|---|
| public static final int SHIFT_MONTH The offset of month bits in date values. | |
| SHIFT_YEAR | back to summary |
|---|---|
| public static final int SHIFT_YEAR The offset of year bits in date values. | |
| DateTimeUtils | back to summary |
|---|---|
| private DateTimeUtils() | |
| absoluteDay | back to summary |
|---|---|
| pack-priv static long absoluteDay(long y, int m, int d) Calculate the absolute day.
| |
| absoluteDayFromDateValue | back to summary |
|---|---|
| public static long absoluteDayFromDateValue(long dateValue) Calculate the absolute day from an encoded date value.
| |
| absoluteDayFromYear | back to summary |
|---|---|
| public static long absoluteDayFromYear(long year) Calculate the absolute day for a January, 1 of the specified year.
| |
| appendDate | back to summary |
|---|---|
| public static StringBuilder appendDate(StringBuilder builder, long dateValue) Append a date to the string builder.
| |
| appendNanos | back to summary |
|---|---|
| pack-priv static StringBuilder appendNanos(StringBuilder builder, int nanos) Append nanoseconds of time, if any.
| |
| appendTime | back to summary |
|---|---|
| public static StringBuilder appendTime(StringBuilder builder, long nanos) Append a time to the string builder.
| |
| appendTimeZone | back to summary |
|---|---|
| public static StringBuilder appendTimeZone(StringBuilder builder, int tz) Append a time zone to the string builder.
| |
| convertScale | back to summary |
|---|---|
| public static long convertScale(long nanosOfDay, int scale, long range) Converts scale of nanoseconds.
| |
| currentTimestamp | back to summary |
|---|---|
| public static ValueTimestampTimeZone currentTimestamp(TimeZoneProvider timeZone) Returns current timestamp.
| |
| currentTimestamp | back to summary |
|---|---|
| public static ValueTimestampTimeZone currentTimestamp(TimeZoneProvider timeZone, Instant now) Returns current timestamp using the specified instant for its value.
| |
| dateAndTimeFromValue | back to summary |
|---|---|
| public static long[] dateAndTimeFromValue(Value value, CastDataProvider provider) Extracts date value and nanos of day from the specified value.
| |
| dateTimeToValue | back to summary |
|---|---|
| public static Value dateTimeToValue(Value original, long dateValue, long timeNanos) Creates a new date-time value with the same type as original value. If original value is a ValueTimestampTimeZone or ValueTimeTimeZone, returned value will have the same time zone offset as original value. | |
| dateValue | back to summary |
|---|---|
| public static long dateValue(long year, int month, int day) Get the date value from a given date.
| |
| dateValueFromAbsoluteDay | back to summary |
|---|---|
| public static long dateValueFromAbsoluteDay(long absoluteDay) Calculate the encoded date value from an absolute day.
| |
| dateValueFromDenormalizedDate | back to summary |
|---|---|
| public static long dateValueFromDenormalizedDate(long year, long month, int day) Get the date value from a given denormalized date with possible out of range values of month and/or day. Used after addition or subtraction month or years to (from) it to get a valid date.
| |
| dateValueFromLocalSeconds | back to summary |
|---|---|
| public static long dateValueFromLocalSeconds(long localSeconds) Convert a local seconds to an encoded date.
| |
| dayFromDateValue | back to summary |
|---|---|
| public static int dayFromDateValue(long x) Get the day of month from a date value.
| |
| decrementDateValue | back to summary |
|---|---|
| public static long decrementDateValue(long dateValue) Return the previous date value.
| |
| getDayOfWeek | back to summary |
|---|---|
| public static int getDayOfWeek(long dateValue, int firstDayOfWeek) Returns day of week.
| |
| getDayOfWeekFromAbsolute | back to summary |
|---|---|
| public static int getDayOfWeekFromAbsolute(long absoluteValue, int firstDayOfWeek) Get the day of the week from the absolute day value.
| |
| getDayOfYear | back to summary |
|---|---|
| public static int getDayOfYear(long dateValue) Returns number of day in year.
| |
| getDaysInMonth | back to summary |
|---|---|
| public static int getDaysInMonth(int year, int month) Returns number of days in month.
| |
| getEpochSeconds | back to summary |
|---|---|
| public static long getEpochSeconds(long dateValue, long timeNanos, int offsetSeconds) Calculates the seconds since epoch for the specified date value, nanoseconds since midnight, and time zone offset.
| |
| getIsoDayOfWeek | back to summary |
|---|---|
| public static int getIsoDayOfWeek(long dateValue) Returns ISO day of week.
| |
| getIsoWeekOfYear | back to summary |
|---|---|
| public static int getIsoWeekOfYear(long dateValue) Returns ISO number of week in year.
| |
| getIsoWeekYear | back to summary |
|---|---|
| public static int getIsoWeekYear(long dateValue) Returns ISO week year.
| |
| getSundayDayOfWeek | back to summary |
|---|---|
| public static int getSundayDayOfWeek(long dateValue) Returns day of week with Sunday as 1.
| |
| getTimeZone | back to summary |
|---|---|
| public static TimeZoneProvider getTimeZone() Get the time zone provider for the default time zone.
| |
| getWeekOfYear | back to summary |
|---|---|
| public static int getWeekOfYear(long dateValue, int firstDayOfWeek, int minimalDaysInFirstWeek) Returns number of week in year.
| |
| getWeekYear | back to summary |
|---|---|
| public static int getWeekYear(long dateValue, int firstDayOfWeek, int minimalDaysInFirstWeek) Returns week year.
| |
| getWeekYearAbsoluteStart | back to summary |
|---|---|
| public static long getWeekYearAbsoluteStart(int weekYear, int firstDayOfWeek, int minimalDaysInFirstWeek) Get absolute day of the first day in the week year.
| |
| incrementDateValue | back to summary |
|---|---|
| public static long incrementDateValue(long dateValue) Return the next date value.
| |
| isLeapYear | back to summary |
|---|---|
| pack-priv static boolean isLeapYear(int year) | |
| isValidDate | back to summary |
|---|---|
| public static boolean isValidDate(int year, int month, int day) Verify if the specified date is valid.
| |
| monthFromDateValue | back to summary |
|---|---|
| public static int monthFromDateValue(long x) Get the month from a date value.
| |
| nanosFromLocalSeconds | back to summary |
|---|---|
| public static long nanosFromLocalSeconds(long localSeconds) Convert a time in seconds in local time to the nanoseconds since midnight.
| |
| normalizeNanosOfDay | back to summary |
|---|---|
| public static long normalizeNanosOfDay(long nanos) Calculate the normalized nanos of day.
| |
| parseDateValue | back to summary |
|---|---|
| public static long parseDateValue(String s, int start, int end) Parse a date string. The format is: [+|-]year-month-day or [+|-]yyyyMMdd.
| |
| parseNanos | back to summary |
|---|---|
| pack-priv static int parseNanos(String s, int start, int end) Parse nanoseconds.
| |
| parseTime | back to summary |
|---|---|
| public static Value parseTime(String s, CastDataProvider provider, boolean withTimeZone) Parses time value from the specified string.
| |
| parseTimeNanos | back to summary |
|---|---|
| public static long parseTimeNanos(String s, int start, int end) Parse a time string. The format is: hour:minute[:second[.nanos]], hhmm[ss[.nanos]], or hour.minute.second[.nanos].
| |
| parseTimestamp | back to summary |
|---|---|
| public static Value parseTimestamp(String s, CastDataProvider provider, boolean withTimeZone) Parses timestamp value from the specified string.
| |
| resetCalendar | back to summary |
|---|---|
| public static void resetCalendar() Reset the cached calendar for default timezone, for example after changing the default timezone. | |
| timestampTimeZoneAtOffset | back to summary |
|---|---|
| public static ValueTimestampTimeZone timestampTimeZoneAtOffset(long dateValue, long timeNanos, int oldOffset, int newOffset) Moves timestamp with time zone to a new time zone.
| |
| timeZoneNameFromOffsetSeconds | back to summary |
|---|---|
| public static String timeZoneNameFromOffsetSeconds(int offsetSeconds) Generates time zone name for the specified offset in seconds.
| |
| yearFromDateValue | back to summary |
|---|---|
| public static int yearFromDateValue(long x) Get the year from a date value.
| |