Add bot age info

This commit is contained in:
2022-12-25 02:12:39 +01:00
parent 7ac72f9e38
commit 52fe279f35
4 changed files with 21 additions and 5 deletions

View File

@@ -15,10 +15,10 @@ public class FormatUtil
*
* @return the formatter String
*/
public static String getNiceUptime()
public static String getNiceTimeDiff(LocalDateTime start)
{
LocalDateTime now = LocalDateTime.now();
long uptimeSeconds = ChronoUnit.SECONDS.between(Cache.getStartupTime(), now);
long uptimeSeconds = ChronoUnit.SECONDS.between(start, now);
Duration uptime = Duration.ofSeconds(uptimeSeconds);
long seconds = uptime.toSecondsPart();
long minutes = uptime.toMinutesPart();
@@ -31,7 +31,7 @@ public class FormatUtil
if(hours == 0)
{
if(minutes == 0)
{} else {
{} else { // i know this if has an empty body but i feel like this reads better
uptimeStringBuilder.append(minutes).append("m ");
}
} else {