public class PackedLocalDateTime extends PackedInstant
The bytes are packed into the date int as: First two bytes: short (year) next byte (month of year) last byte (day of month)
The bytes are packed into the time int as First byte: hourOfDay next byte: minuteOfHour last two bytes (short): millisecond of minute
Storing the millisecond of minute in an short requires that we treat the short as if it were unsigned. Unfortunately, Neither Java nor Guava provide unsigned short support so we use char, which is a 16-bit unsigned int to store values of up to 60,000 milliseconds (60 secs * 1000)
Modifier and Type | Method | Description |
---|---|---|
static boolean |
AM(long packedDateTime) |
Returns true if the time is in the AM or "before noon".
|
static LocalDateTime |
asLocalDateTime(long dateTime) |
|
static int |
date(long packedDateTIme) |
|
static byte |
getDayOfMonth(long date) |
|
static DayOfWeek |
getDayOfWeek(long packedDateTime) |
|
static int |
getDayOfYear(long packedDateTime) |
|
static byte |
getHour(long packedLocalDateTime) |
|
static long |
getMillisecondOfDay(long packedLocalDateTime) |
|
static short |
getMillisecondOfMinute(long packedLocalDateTime) |
|
static byte |
getMinute(long packedLocalDateTime) |
|
static int |
getMinuteOfDay(long packedLocalDateTime) |
|
static Month |
getMonth(long packedDateTime) |
|
static byte |
getMonthValue(long dateTime) |
|
static int |
getQuarter(long packedDate) |
Returns the quarter of the year of the given date as an int from 1 to 4, or -1, if the argument
is the missingValueIndicator() for DateTimeColumn
|
static byte |
getSecond(int packedLocalDateTime) |
|
static byte |
getSecond(long packedLocalDateTime) |
|
static int |
getSecondOfDay(long packedLocalDateTime) |
|
static int |
getWeekOfYear(long packedDateTime) |
|
static short |
getYear(long dateTime) |
|
static boolean |
isAfter(long packedDateTime,
long value) |
|
static boolean |
isBefore(long packedDateTime,
long value) |
|
static boolean |
isFirstDayOfMonth(long packedDateTime) |
|
static boolean |
isFriday(long packedDateTime) |
|
static boolean |
isInApril(long packedDateTime) |
|
static boolean |
isInAugust(long packedDateTime) |
|
static boolean |
isInDecember(long packedDateTime) |
|
static boolean |
isInFebruary(long packedDateTime) |
|
static boolean |
isInJanuary(long packedDateTime) |
|
static boolean |
isInJuly(long packedDateTime) |
|
static boolean |
isInJune(long packedDateTime) |
|
static boolean |
isInMarch(long packedDateTime) |
|
static boolean |
isInMay(long packedDateTime) |
|
static boolean |
isInNovember(long packedDateTime) |
|
static boolean |
isInOctober(long packedDateTime) |
|
static boolean |
isInQ1(long packedDateTime) |
|
static boolean |
isInQ2(long packedDateTime) |
|
static boolean |
isInQ3(long packedDateTime) |
|
static boolean |
isInQ4(long packedDateTime) |
|
static boolean |
isInSeptember(long packedDateTime) |
|
static boolean |
isInYear(long packedDateTime,
int year) |
|
static boolean |
isLastDayOfMonth(long packedDateTime) |
|
static boolean |
isLeapYear(long packedDateTime) |
|
static boolean |
isMidnight(long packedDateTime) |
|
static boolean |
isMonday(long packedDateTime) |
|
static boolean |
isNoon(long packedDateTime) |
|
static boolean |
isSaturday(long packedDateTime) |
|
static boolean |
isSunday(long packedDateTime) |
|
static boolean |
isThursday(long packedDateTime) |
|
static boolean |
isTuesday(long packedDateTime) |
|
static boolean |
isWednesday(long packedDateTime) |
|
static int |
lengthOfMonth(long packedDateTime) |
|
static int |
lengthOfYear(long packedDateTime) |
|
static int |
monthsUntil(long packedDateTimeEnd,
long packedDateStart) |
|
static long |
pack(short yr,
byte m,
byte d,
byte hr,
byte min,
byte s,
byte n) |
|
static long |
pack(LocalDate date,
LocalTime time) |
|
static long |
pack(LocalDateTime dateTime) |
|
static boolean |
PM(long packedDateTime) |
Returns true if the time is in the PM or "after noon".
|
static int |
time(long packedDateTIme) |
|
static String |
toString(long dateTime) |
|
static int |
yearsUntil(long packedDateEnd,
long packedDateStart) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
asInstant, create, daysUntil, hoursUntil, isEqualTo, isOnOrAfter, isOnOrBefore, minutesUntil, pack, plus, weeksUntil
public static byte getDayOfMonth(long date)
public static short getYear(long dateTime)
public static LocalDateTime asLocalDateTime(long dateTime)
public static byte getMonthValue(long dateTime)
public static long pack(LocalDateTime dateTime)
public static long pack(short yr, byte m, byte d, byte hr, byte min, byte s, byte n)
public static int date(long packedDateTIme)
public static int time(long packedDateTIme)
public static String toString(long dateTime)
public static int getDayOfYear(long packedDateTime)
public static int getWeekOfYear(long packedDateTime)
public static boolean isLeapYear(long packedDateTime)
public static Month getMonth(long packedDateTime)
public static int lengthOfMonth(long packedDateTime)
public static DayOfWeek getDayOfWeek(long packedDateTime)
public static int getQuarter(long packedDate)
public static boolean isInQ1(long packedDateTime)
public static boolean isInQ2(long packedDateTime)
public static boolean isInQ3(long packedDateTime)
public static boolean isInQ4(long packedDateTime)
public static boolean isAfter(long packedDateTime, long value)
public static boolean isBefore(long packedDateTime, long value)
public static boolean isSunday(long packedDateTime)
public static boolean isMonday(long packedDateTime)
public static boolean isTuesday(long packedDateTime)
public static boolean isWednesday(long packedDateTime)
public static boolean isThursday(long packedDateTime)
public static boolean isFriday(long packedDateTime)
public static boolean isSaturday(long packedDateTime)
public static boolean isFirstDayOfMonth(long packedDateTime)
public static boolean isInJanuary(long packedDateTime)
public static boolean isInFebruary(long packedDateTime)
public static boolean isInMarch(long packedDateTime)
public static boolean isInApril(long packedDateTime)
public static boolean isInMay(long packedDateTime)
public static boolean isInJune(long packedDateTime)
public static boolean isInJuly(long packedDateTime)
public static boolean isInAugust(long packedDateTime)
public static boolean isInSeptember(long packedDateTime)
public static boolean isInOctober(long packedDateTime)
public static boolean isInNovember(long packedDateTime)
public static boolean isInDecember(long packedDateTime)
public static boolean isLastDayOfMonth(long packedDateTime)
public static boolean isInYear(long packedDateTime, int year)
public static boolean isMidnight(long packedDateTime)
public static boolean isNoon(long packedDateTime)
public static boolean AM(long packedDateTime)
public static boolean PM(long packedDateTime)
public static int getMinuteOfDay(long packedLocalDateTime)
public static byte getSecond(int packedLocalDateTime)
public static byte getHour(long packedLocalDateTime)
public static byte getMinute(long packedLocalDateTime)
public static byte getSecond(long packedLocalDateTime)
public static int getSecondOfDay(long packedLocalDateTime)
public static short getMillisecondOfMinute(long packedLocalDateTime)
public static long getMillisecondOfDay(long packedLocalDateTime)
public static int lengthOfYear(long packedDateTime)
public static int monthsUntil(long packedDateTimeEnd, long packedDateStart)
public static int yearsUntil(long packedDateEnd, long packedDateStart)
Copyright © 2022. All rights reserved.