List of utility methods to do OffsetDateTime
Date | asDate(Calendar calendar) as Date return new Date(calendar.getTimeInMillis()); |
E | cloneInternally(E source, Map clone Internally if (source == null) { return null; Class<?> clazz = source.getClass(); if (clazz.isEnum() || IMMUTABLES.contains(clazz)) { return source; if (clazz == Date.class) { ... |
int | compareChrono(TemporalAccessor date1, TemporalAccessor date2) compare Chrono return compareChrono(date1, date2, false);
|
int | compareOffsetDateTimes(OffsetDateTime offsetDateTime1, OffsetDateTime offsetDateTime2) compare Offset Date Times if (offsetDateTime1 == offsetDateTime2) { return 0; if (offsetDateTime1 == null) { return -1; if (offsetDateTime2 == null) { return 1; ... |
OffsetDateTime | convertDateToOffsetDateTime(Date date) Converts the old Date to a new OffsetDateTime , taking the UTC offset into account. return OffsetDateTime.ofInstant(date.toInstant(), ZoneId.of("UTC")); |
String | getCurrentISODate() get Current ISO Date return ms2OffsetDateTime(System.currentTimeMillis()).format(ISO_DATE);
|
String | getDateTimeString(OffsetDateTime time) Returns a prettier String-representation of a OffsetDateTime object return time.format(dtFormatter);
|
OffsetDateTime | getNowOdt() get Now Odt return OffsetDateTime.now(ZoneOffset.UTC);
|
boolean | hasZone(TemporalAccessor date) has Zone if (date == null) { return false; if (date instanceof ZonedDateTime) { return true; } else if (date instanceof OffsetDateTime) { return true; } else if (date instanceof OffsetTime) { ... |
OffsetDateTime | next(OffsetDateTime date, OffsetTime time) next OffsetDateTime newDate = date.with(time); if (newDate.isBefore(date)) { return newDate.plusDays(1); return newDate; |