|
|
@@ -60,13 +60,6 @@ public class DateTimeUtils1 {
|
|
|
return LocalTime.MAX.equals(dateTime.toLocalTime());
|
|
|
}
|
|
|
|
|
|
- public static String extractTimeInPolishTimezone(ZonedDateTime dateTime) {
|
|
|
- if (dateTime != null) {
|
|
|
- return polishTime(dateTime).toLocalTime().format(TIME_FORMAT);
|
|
|
- }
|
|
|
- return "";
|
|
|
- }
|
|
|
-
|
|
|
public static ZonedDateTime lastDayOfMonth(ZonedDateTime date) {
|
|
|
return date
|
|
|
.withDayOfMonth(1)
|
|
|
@@ -91,10 +84,6 @@ public class DateTimeUtils1 {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- private static <T, R> R mapNullable(T value, Function<T, R> mapper) {
|
|
|
- return Objects.isNull(value) ? null : mapper.apply(value);
|
|
|
- }
|
|
|
-
|
|
|
public static Duration timeDiff(LocalTime from, LocalTime to) {
|
|
|
if (from.isAfter(to)) {
|
|
|
return Duration.of(24, ChronoUnit.HOURS).minus(Duration.between(to, from));
|
|
|
@@ -102,13 +91,6 @@ public class DateTimeUtils1 {
|
|
|
return Duration.between(from, to);
|
|
|
}
|
|
|
|
|
|
- public static Duration timeDiff(ZonedDateTime from, ZonedDateTime to) {
|
|
|
- if (from.isAfter(to)) {
|
|
|
- return Duration.of(24, ChronoUnit.HOURS).minus(Duration.between(to, from));
|
|
|
- }
|
|
|
- return Duration.between(from, to);
|
|
|
- }
|
|
|
-
|
|
|
public static Duration timeDiff(ZonedTime1 from, ZonedTime1 to) {
|
|
|
if(!from.getZone().equals(to.getZone())) {
|
|
|
throw new IllegalArgumentException();
|
|
|
@@ -119,15 +101,4 @@ public class DateTimeUtils1 {
|
|
|
return Duration.between(from.getTimestamp(), to.getTimestamp());
|
|
|
}
|
|
|
|
|
|
- public static ZonedDate1 literal(int y, int m, int d) {
|
|
|
- return ZonedDate1.from(literal(y, m, d, 0, 0, 0));
|
|
|
- }
|
|
|
-
|
|
|
- public static ZonedDateTime literal(int y, int m, int d, int H, int M) {
|
|
|
- return literal(y, m, d, H, M, 0);
|
|
|
- }
|
|
|
-
|
|
|
- public static ZonedDateTime literal(int y, int m, int d, int H, int M, int S) {
|
|
|
- return LocalDateTime.of(y, m, d, H, M, S).atZone(ZONE_POLAND);
|
|
|
- }
|
|
|
}
|