List of utility methods to do Instant Calculate
long | convertInstantToDotNetTicks(Instant instant) convert Instant To Dot Net Ticks return (instant.getEpochSecond() * 10000000) + (instant.getNano() / 100) + EPOCHINDOTNETTICKS;
|
ZonedDateTime | convertToUserTimeZone(Instant timeInSystem, ZoneId userZoneId) convert To User Time Zone return timeInSystem.atZone(userZoneId);
|
Date | dateOf(final Instant time) Gets Date for Instant. return Date.from(time);
|
Instant | epochToInstant(long epochMilliSecond) epoch To Instant return Instant.ofEpochMilli(epochMilliSecond);
|
File | getNquadsFile(final File dir, final Instant time) Get the nquads file for a given moment in time. return new File(dir, Long.toString(time.getEpochSecond()) + ".nq"); |
Instant | getPeriodInstant(LocalDate localDate) get Period Instant LocalDateTime localDateTime = localDate.atStartOfDay();
return localDateTime.toInstant(ZoneOffset.UTC);
|
long | getSnowflakeFromTimestamp(Instant date) Gets a snowflake from a unix timestamp. return (date.toEpochMilli() - DISCORD_EPOCH) << 22;
|
boolean | isEqualOrAfterNow(Instant now, Instant instant) is Equal Or After Now return !instant.isBefore(now);
|
Instant | maxInstant(Instant v1, Instant v2) max Instant if (v1 == null) { throw new IllegalArgumentException("Instant v1 is null"); } else if (v2 == null) { throw new IllegalArgumentException("Instant v2 is null"); return v1.isAfter(v2) ? v1 : v2; |
long | nanos(Instant instant) nanos return instant.getEpochSecond() * 1000_000_000L + instant.getNano();
|