List of utility methods to do LocalDateTime Calculate
String | convertDatabaseDateToUSTime(LocalDateTime databaseDate) convert Database Date To US Time if (databaseDate != null) { return databaseDate.format(DateTimeFormatter.ofPattern("hh:mm a")); } else { return ""; |
LocalDateTime | converterZoneDatetimeToLocalDateTime(final String date) converter Zone Datetime To Local Date Time ZonedDateTime zdt = ZonedDateTime.parse(date);
return zdt.toLocalDateTime();
|
long | currentTimeMillis(LocalDateTime ldt) current Time Millis return ldt.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli();
|
LocalDateTime | DateTime2LocalDateTime(Date datetime) Date Time Local Date Time Instant timestamp = datetime.toInstant(); LocalDateTime localDateTime = LocalDateTime.ofInstant(timestamp, ZoneId.of(ZoneId.SHORT_IDS.get("CTT"))); return localDateTime; |
long | dateTimeToOleMinutes(LocalDateTime datetime) date Time To Ole Minutes return Duration.between(OLE_AUTOMATION_TIME_START, datetime).toMinutes();
|
long | dayDuration(LocalDateTime startDateTime, LocalDateTime endDateTime) day Duration return duration(startDateTime, endDateTime).toDays();
|
char[] | fastDateTimeWriteHours(LocalDateTime localDateTime) fast Date Time Write Hours char[] c = new char[13]; LocalDate localDate = localDateTime.toLocalDate(); int y = localDate.getYear(); c[0] = (char) ('0' + y / 1000); c[1] = (char) ('0' + ((y % 1000) / 100)); c[2] = (char) ('0' + ((y % 100) / 10)); c[3] = (char) ('0' + (y % 10)); c[4] = (char) ('-'); ... |
LocalDateTime | getShiftResult(ImmutableMap get Shift Result LocalDateTime result = reference; int futureOrPast = future ? 1 : -1; for (Map.Entry<String, Double> pair : timexUnitMap.entrySet()) { String unit = pair.getKey(); Double number = pair.getValue(); switch (unit) { case "H": result = result.plusHours(Math.round(number * futureOrPast)); ... |
int | getStartWeekOfMonth(@Nonnull final LocalDateTime aDT, @Nonnull final Locale aLocale) Get the start--week number for the passed year and month. return getWeekOfWeekBasedYear(aDT.withDayOfMonth(1), aLocale);
|
LocalTime | getTimePart(final LocalDateTime dateTime) get Time Part return dateTime.toLocalTime();
|