Package dev.webfx.platform.util.time
Class Times
java.lang.Object
dev.webfx.platform.util.time.Times
- Author:
- Bruno Salmon
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Instant
static LocalDate
asLocalDate
(Object value) static LocalDateTime
asLocalDateTime
(Object value) static LocalTime
asLocalTime
(Object value) static LocalDateTime
epochMillisToLocalDateTime
(long epochMillis, ZoneOffset offset) static LocalDateTime
epochMillisUtcToLocalDateTime
(long epochMillis) static Instant
static Object
fastToInstantIfIsoString
(Object value) static String
static String
static String
format
(LocalDateTime dateTime, String pattern) Formats a datestatic String
format
(ZonedDateTime dateTime, String pattern) static String
static String
formatIso
(LocalDateTime date) static boolean
static boolean
isBetween
(LocalDateTime dateToCheck, LocalDateTime startDate, LocalDateTime endDate) static boolean
static boolean
static boolean
isFuture
(LocalDateTime date) static boolean
isFuture
(LocalDateTime date, Clock clock) static boolean
static boolean
static boolean
isPast
(LocalDateTime date) static boolean
isPast
(LocalDateTime date, Clock clock) static long
localDateTimeToEpochMillis
(LocalDateTime dateTime, ZoneOffset offset) static long
localDateTimeToEpochMillisUtc
(LocalDateTime dateTime) static Instant
static LocalDate
static LocalDateTime
static Instant
static LocalDate
toLocalDate
(Object value) static LocalDate
static LocalDateTime
static LocalDateTime
toLocalDateTime
(Object value) static LocalDateTime
static LocalDateTime
toLocalDateTime
(LocalDate localDate) static LocalDateTime
toLocalDateTime
(LocalTime localTime)
-
Constructor Details
-
Times
public Times()
-
-
Method Details
-
asInstant
-
asLocalDateTime
-
asLocalDate
-
asLocalTime
-
parseIsoInstant
-
fastCheckParseIsoInstant
-
fastToInstantIfIsoString
-
parseIsoLocalDate
-
parseIsoLocalDateTime
-
toInstant
-
formatIso
-
toLocalDateTime
-
toLocalDateTime
-
toLocalDateTime
-
toLocalDateTime
-
toLocalDateTime
-
toLocalDate
-
toLocalDate
-
epochMillisUtcToLocalDateTime
-
epochMillisToLocalDateTime
-
localDateTimeToEpochMillisUtc
-
localDateTimeToEpochMillis
-
format
-
format
Formats a date- Parameters:
dateTime
- the date to formatpattern
- the format pattern, ex: dd/MM/yyyy HH:mm:ss- Returns:
- the formatted date
-
formatIso
-
format
-
format
-
isPast
-
isPast
-
isFuture
-
isFuture
-
isBetween
-
isPast
-
isPast
-
isFuture
-
isFuture
-
isBetween
public static boolean isBetween(LocalDateTime dateToCheck, LocalDateTime startDate, LocalDateTime endDate)
-