List of utility methods to do LocalDateTime to
long | getMillis(LocalDateTime time) get Millis if (time == null) { return 0; Instant instant = ((ChronoZonedDateTime) time.atZone(ZoneId.systemDefault())).toInstant(); return instant.toEpochMilli(); |
int | getMinuteOfDay(LocalDateTime ldt) Get the minute of the day for a given java.time.LocalDateTime . return ((ldt.getHour() * 60) + ldt.getMinute());
|
long | getSecondsSinceJavaEpoch(LocalDateTime localDateTime) get Seconds Since Java Epoch OffsetDateTime zdt = localDateTime.atOffset(ZoneOffset.UTC); long milliseconds = zdt.toInstant().toEpochMilli(); return TimeUnit.MILLISECONDS.toSeconds(milliseconds); |
Date | localDateTimeToDate(LocalDateTime ldt) local Date Time To Date return Date.from(ldt.atZone(TimeZone.getDefault().toZoneId()).toInstant());
|
long | localDateTimeToEpochMillis(TemporalAccessor temporal) Convert a TemporalAccess to an Epoch value. return temporalToInstant(temporal).toEpochMilli();
|
String | localDateTimeToString(LocalDateTime value) localDateTimeToString, This will return the supplied LocalDateTime as a string. return (value == null) ? "" : value.toString(); |
long | localDateTimeToTimestamp(LocalDateTime ldt) local Date Time To Timestamp return ldt.toEpochSecond(ZoneOffset.UTC);
|
LocalDateTime | longTOLocalDateTime(long minDate) long TO Local Date Time LocalDateTime time = LocalDateTime.ofEpochSecond(minDate, 0, ZoneOffset.UTC);
return time;
|
String | luisDate(LocalDateTime date) luis Date return luisDate(date.getYear(), date.getMonthValue(), date.getDayOfMonth());
|
LocalDateTime | millisToLocalDateTime(Long inMillis) millis To Local Date Time return millisToLocalDateTime(inMillis, ZoneId.systemDefault());
|