List of utility methods to do LocalDateTime Create
LocalDateTime | asLocalDateTime(Date date) Obtains an instance of LocalDateTime from a date object. return asLocalDateTime(date, getDefaultTimeZone());
|
LocalDateTime | asLocalDateTime(Date date) Calls #asLocalDateTime(Date,ZoneId) with the system default time zone. return asLocalDateTime(date, ZoneId.systemDefault());
|
LocalDateTime | getLocalDateTime(Date datetime, TimeZone timeZone) Find a java.time.LocalDateTime for the given user java.util.Date and java.util.TimeZone . if (datetime == null) { return null; if (timeZone == null) { return null; ZoneId zoneId = timeZone.toZoneId(); return LocalDateTime.ofInstant(datetime.toInstant(), zoneId); ... |
LocalDateTime | getLocalDateTimeFromEpochMilli(long epochMillis) Convert milliseconds from epoch to a LocalDateTime with UTC offset. final LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(epochMillis), ZoneOffset.UTC.normalized()); return localDateTime; |
LocalDateTime | getLocalDateTimeFromMillis(final long millis) get Local Date Time From Millis return LocalDateTime.of(1970, 1, 1, 0, 0, 0).plus(millis, ChronoUnit.MILLIS);
|
LocalDateTime | getLocalDateTimeFromMillis(long millis) Shorthand method to return a LocalDateTime from 'millis since longAgo'. return LocalDateTime.from(Instant.ofEpochMilli(millis));
|
LocalDateTime | localDateTime(Date date, Clock clock) local Date Time return LocalDateTime.ofInstant(date.toInstant(), clock.getZone());
|
LocalDateTime | localDateTimeOf(final String value) Parse the given value as a local datetime. try { return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME); } catch (final Exception e) { return null; |
LocalDateTime | toLocalDateTime(java.util.Date d) to Local Date Time LocalDateTime ldt = (d == null ? null : LocalDateTime.fromDateFields(d));
return ldt;
|
Object | toLocalDateTime(long systemMillis) Return the system millis time as a LocalDateTime. return new Timestamp(systemMillis).toLocalDateTime(); |