PackedLocalDateTime extends PackedInstant { public static LocalDateTime asLocalDateTime(long dateTime) { if (dateTime == missingValueIndicator()) { return null; } int date = date(dateTime); int time = time(dateTime); LocalDate d = PackedLocalDate.asLocalDate(date); LocalTime t = PackedLocalTime.asLocalTime(time); if (d == null || t == null) { return null; } return LocalDateTime.of(d, t); } private  PackedLocalDateTime(); static byte getDayOfMonth(long date); static short getYear(long dateTime); static LocalDateTime asLocalDateTime(long dateTime); static byte getMonthValue(long dateTime); static long pack(LocalDate date, LocalTime time); static long pack(LocalDateTime dateTime); static long pack(short yr, byte m, byte d, byte hr, byte min, byte s, byte n); static int date(long packedDateTIme); static int time(long packedDateTIme); static String toString(long dateTime); static int getDayOfYear(long packedDateTime); static int getWeekOfYear(long packedDateTime); static boolean isLeapYear(long packedDateTime); static Month getMonth(long packedDateTime); static int lengthOfMonth(long packedDateTime); static DayOfWeek getDayOfWeek(long packedDateTime); static int getQuarter(long packedDate); static boolean isInQ1(long packedDateTime); static boolean isInQ2(long packedDateTime); static boolean isInQ3(long packedDateTime); static boolean isInQ4(long packedDateTime); static boolean isAfter(long packedDateTime, long value); static boolean isBefore(long packedDateTime, long value); static boolean isSunday(long packedDateTime); static boolean isMonday(long packedDateTime); static boolean isTuesday(long packedDateTime); static boolean isWednesday(long packedDateTime); static boolean isThursday(long packedDateTime); static boolean isFriday(long packedDateTime); static boolean isSaturday(long packedDateTime); static boolean isFirstDayOfMonth(long packedDateTime); static boolean isInJanuary(long packedDateTime); static boolean isInFebruary(long packedDateTime); static boolean isInMarch(long packedDateTime); static boolean isInApril(long packedDateTime); static boolean isInMay(long packedDateTime); static boolean isInJune(long packedDateTime); static boolean isInJuly(long packedDateTime); static boolean isInAugust(long packedDateTime); static boolean isInSeptember(long packedDateTime); static boolean isInOctober(long packedDateTime); static boolean isInNovember(long packedDateTime); static boolean isInDecember(long packedDateTime); static boolean isLastDayOfMonth(long packedDateTime); static boolean isInYear(long packedDateTime, int year); static boolean isMidnight(long packedDateTime); static boolean isNoon(long packedDateTime); static boolean AM(long packedDateTime); static boolean PM(long packedDateTime); static int getMinuteOfDay(long packedLocalDateTime); static byte getSecond(int packedLocalDateTime); static byte getHour(long packedLocalDateTime); static byte getMinute(long packedLocalDateTime); static byte getSecond(long packedLocalDateTime); static int getSecondOfDay(long packedLocalDateTime); static short getMillisecondOfMinute(long packedLocalDateTime); static long getMillisecondOfDay(long packedLocalDateTime); static int lengthOfYear(long packedDateTime); static int monthsUntil(long packedDateTimeEnd, long packedDateStart); static int yearsUntil(long packedDateEnd, long packedDateStart);  }
@Test public void testAsLocalDateTime() { LocalDateTime dateTime = LocalDateTime.now(); long packed = pack(dateTime.toLocalDate(), dateTime.toLocalTime()); LocalDateTime upacked = asLocalDateTime(packed); assertEquals(dateTime.getDayOfYear(), upacked.getDayOfYear()); assertEquals(dateTime.getHour(), upacked.getHour()); assertEquals(dateTime.getMinute(), upacked.getMinute()); assertEquals(dateTime.getSecond(), upacked.getSecond()); }