@@ -0,0 +1,1700 @@
+package io.github.likcoras.ssbot.util;%0A%0Apublic class TimeDiff %7B%0A%09%0A%09private static final long SECOND = 1000L;%0A%09private static final long MINUTE = 60L;%0A%09private static final long HOUR = MINUTE;%0A%09private static final long DAY = 24L;%0A%09private static final long WEEK = 7L;%0A%09%0A%09long seconds;%0A%09long minutes;%0A%09long hours;%0A%09long days;%0A%09long weeks;%0A%09%0A%09public TimeDiff(final long millis) %7B%0A%09%09%0A%09%09seconds = millis / SECOND;%0A%09%09minutes = seconds / MINUTE;%0A%09%09hours = minutes / HOUR;%0A%09%09days = hours / DAY;%0A%09%09weeks = days / WEEK;%0A%09%09%0A%09%09days = days %25 WEEK;%0A%09%09hours = hours %25 DAY;%0A%09%09minutes = minutes %25 HOUR;%0A%09%09seconds = seconds %25 MINUTE;%0A%09%09%0A%09%7D%0A%09%0A%09public String getSimpleMessage() %7B%0A%09%09%0A%09%09String out = null;%0A%09%09if (!(out = getSub(weeks, days, %22weeks%22, %22days%22)).isEmpty()%0A%09%09%09%7C%7C !(out = getSub(days, hours, %22days%22, %22hours%22)).isEmpty()%0A%09%09%09%7C%7C !(out = getSub(hours, minutes, %22hours%22, %22minutes%22)).isEmpty()%0A%09%09%09%7C%7C !(out = getSub(minutes, seconds, %22minutes%22, %22seconds%22))%0A%09%09%09%09.isEmpty()%0A%09%09%09%7C%7C !(out = getSub(seconds, 0, %22seconds%22, null)).isEmpty())%0A%09%09%09return out;%0A%09%09%0A%09%09return %22now%22;%0A%09%09%0A%09%7D%0A%09%0A%09private String getSub(final long high, final long low,%0A%09%09final String highName, final String lowName) %7B%0A%09%09%0A%09%09if (high %3C 1)%0A%09%09%09return %22%22;%0A%09%09%0A%09%09String out = high + %22 %22 + highName;%0A%09%09%0A%09%09if (low %3E 0)%0A%09%09%09out += %22 %22 + low + %22 %22 + lowName;%0A%09%09%0A%09%09return out;%0A%09%09%0A%09%7D%0A%09%0A%09public String getComplexMessage() %7B%0A%09%09%0A%09%09String out = %22%22;%0A%09%09%0A%09%09if (weeks %3E 0)%0A%09%09%09out += weeks + %22 weeks %22;%0A%09%09if (days %3E 0)%0A%09%09%09out += days + %22 days %22;%0A%09%09if (hours %3E 0)%0A%09%09%09out += hours + %22 hours %22;%0A%09%09if (minutes %3E 0)%0A%09%09%09out += minutes + %22 minutes %22;%0A%09%09if (seconds %3E 0)%0A%09%09%09out += seconds + %22 seconds %22;%0A%09%09%0A%09%09return out.isEmpty() ? %22now%22 : out.substring(0, out.length() - 1);%0A%09%09%0A%09%7D%0A%09%0A%7D%0A

Add TimeDiff