Here, taken from my quester
public int getSecondsLeftTeleportHome() {
int lastTeleport = getConfigs().get(892);
long lastTeleportSeconds = (long) lastTeleport * 60;
Instant teleportExpireInstant = Instant.ofEpochSecond(lastTeleportSeconds).plus(Duration.ofMinutes(30));
Duration remainingTime = Duration.between(Instant.now(), teleportExpireInstant);
return (int) remainingTime.getSeconds();
}