Class TimestampUtility
- java.lang.Object
-
- io.tech1.framework.domain.utilities.time.TimestampUtility
-
public final class TimestampUtility extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static longgetCurrentMonthAtStartOfMonthAndAtStartOfDayTimestamp(ZoneId zoneId)static longgetCurrentMonthAtStartOfMonthAndAtStartOfDayTimestampUTC()static longgetCurrentTimestamp()static Tuple2<Long,Long>getFutureRange(TimeAmount timeAmount)static longgetNMonthAgoAtStartOfMonthAndAtStartOfDayTimestamp(ZoneId zoneId, int monthAgo)static longgetNMonthAgoAtStartOfMonthAndAtStartOfDayTimestampUTC(int monthAgo)static Tuple2<Long,Long>getPastRange(TimeAmount timeAmount)static longgetPreviousMonthAtStartOfMonthAndAtStartOfDayTimestamp(ZoneId zoneId)static longgetPreviousMonthAtStartOfMonthAndAtStartOfDayTimestampUTC()static booleanisBetween(long timestamp, long past, long future)static booleanisCurrentTimestampNSecondsMore(long timestamp, long seconds)static booleanisFuture(long timestamp)static booleanisPast(long timestamp)static longtoUnixTime(long timestamp)
-
-
-
Method Detail
-
getCurrentTimestamp
public static long getCurrentTimestamp()
-
toUnixTime
public static long toUnixTime(long timestamp)
-
getCurrentMonthAtStartOfMonthAndAtStartOfDayTimestampUTC
public static long getCurrentMonthAtStartOfMonthAndAtStartOfDayTimestampUTC()
-
getCurrentMonthAtStartOfMonthAndAtStartOfDayTimestamp
public static long getCurrentMonthAtStartOfMonthAndAtStartOfDayTimestamp(ZoneId zoneId)
-
getPreviousMonthAtStartOfMonthAndAtStartOfDayTimestampUTC
public static long getPreviousMonthAtStartOfMonthAndAtStartOfDayTimestampUTC()
-
getPreviousMonthAtStartOfMonthAndAtStartOfDayTimestamp
public static long getPreviousMonthAtStartOfMonthAndAtStartOfDayTimestamp(ZoneId zoneId)
-
getNMonthAgoAtStartOfMonthAndAtStartOfDayTimestampUTC
public static long getNMonthAgoAtStartOfMonthAndAtStartOfDayTimestampUTC(int monthAgo)
-
getNMonthAgoAtStartOfMonthAndAtStartOfDayTimestamp
public static long getNMonthAgoAtStartOfMonthAndAtStartOfDayTimestamp(ZoneId zoneId, int monthAgo)
-
getPastRange
public static Tuple2<Long,Long> getPastRange(TimeAmount timeAmount)
-
getFutureRange
public static Tuple2<Long,Long> getFutureRange(TimeAmount timeAmount)
-
isBetween
public static boolean isBetween(long timestamp, long past, long future)
-
isPast
public static boolean isPast(long timestamp)
-
isFuture
public static boolean isFuture(long timestamp)
-
isCurrentTimestampNSecondsMore
public static boolean isCurrentTimestampNSecondsMore(long timestamp, long seconds)
-
-