Package io.tesler.core.util
Class DateTimeUtil
- java.lang.Object
-
- io.tesler.core.util.DateTimeUtil
-
public final class DateTimeUtil extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static DateTimeFormatter
DATE_TIME_FORMATTER
static Pattern
ISO_PATTERN
static String
TIMESTAMP_FORMAT
-
Constructor Summary
Constructors Constructor Description DateTimeUtil()
-
Method Summary
-
-
-
Field Detail
-
ISO_PATTERN
public static final Pattern ISO_PATTERN
-
TIMESTAMP_FORMAT
public static final String TIMESTAMP_FORMAT
- See Also:
- Constant Field Values
-
DATE_TIME_FORMATTER
public static final DateTimeFormatter DATE_TIME_FORMATTER
-
-
Method Detail
-
dateTimeToString
public static String dateTimeToString(LocalDateTime dateTime, String pattern)
-
dateTimeToString
public static String dateTimeToString(LocalDateTime dateTime)
-
stringToDateTime
public static LocalDateTime stringToDateTime(String dateTime)
-
toDate
public static Date toDate(LocalDateTime localDateTime)
-
toLocalDateTime
public static LocalDateTime toLocalDateTime(Date date)
-
toLocalDateTime
public static LocalDateTime toLocalDateTime(Calendar cal)
-
toLocalDateTime
public static LocalDateTime toLocalDateTime(XMLGregorianCalendar calendar)
-
toLocalDateTime
public static LocalDateTime toLocalDateTime(Instant instant)
-
toLocalDateTime
public static LocalDateTime toLocalDateTime(OffsetDateTime offsetDateTime)
-
toLocalDateTime
public static LocalDateTime toLocalDateTime(ZonedDateTime zonedDateTime)
-
toLocalDateTime
public static LocalDateTime toLocalDateTime(Date date)
-
toInstant
public static Instant toInstant(LocalDateTime localDateTime, ZoneId zoneId)
-
toInstant
public static Instant toInstant(LocalDateTime localDateTime)
-
toZonedDateTime
public static ZonedDateTime toZonedDateTime(LocalDateTime localDateTime, ZoneId zoneId)
-
now
public static LocalDateTime now()
-
sessionNow
public static LocalDateTime sessionNow()
-
toSession
public static TemporalAdjuster toSession()
-
toSession
public static TemporalAdjuster toSession(boolean tzAware)
-
toSession
public static LocalDateTime toSession(LocalDateTime localDateTime)
-
fromSession
public static LocalDateTime fromSession(LocalDateTime localDateTime)
-
fromSession
public static TemporalAdjuster fromSession()
-
fromSession
public static TemporalAdjuster fromSession(boolean tzAware)
-
asEndOfDay
public static TemporalAdjuster asEndOfDay()
-
asStartOfDay
public static TemporalAdjuster asStartOfDay()
-
switchZone
public static LocalDateTime switchZone(LocalDateTime localDateTime, ZoneId from, ZoneId to)
-
toOracleSql
public static String toOracleSql(LocalDateTime localDateTime)
-
getNumberMonthByName
public static int getNumberMonthByName(String key)
-
asStartOfQ1
public static TemporalAdjuster asStartOfQ1()
-
asEndOfQ1
public static TemporalAdjuster asEndOfQ1()
-
asStartOfQ2
public static TemporalAdjuster asStartOfQ2()
-
asEndOfQ2
public static TemporalAdjuster asEndOfQ2()
-
asStartOfQ3
public static TemporalAdjuster asStartOfQ3()
-
asEndOfQ3
public static TemporalAdjuster asEndOfQ3()
-
asStartOfQ4
public static TemporalAdjuster asStartOfQ4()
-
asEndOfQ4
public static TemporalAdjuster asEndOfQ4()
-
asStartOfFirstHalfYear
public static TemporalAdjuster asStartOfFirstHalfYear()
-
asEndOfFirstHalfYear
public static TemporalAdjuster asEndOfFirstHalfYear()
-
asStartOfSecondHalfYear
public static TemporalAdjuster asStartOfSecondHalfYear()
-
asEndOfSecondHalfYear
public static TemporalAdjuster asEndOfSecondHalfYear()
-
isMonthYearAfterDate
public static boolean isMonthYearAfterDate(String month, String year, LocalDateTime createdDateTime)
-
isSameDay
public static boolean isSameDay(LocalDateTime dateTime1, LocalDateTime dateTime2)
-
-