1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2024-11-22 08:52:18 -05:00

Fixed timestamp. Prefix number with 0 if they are < 10

This commit is contained in:
Sebastian Kaspari 2010-03-14 01:07:11 +01:00
parent 2d585d6a72
commit 5140646fd4

View File

@ -161,11 +161,12 @@ public class Message {
Date date = new Date();
int hours = date.getHours();
int minutes = date.getMinutes();
if (!use24hFormat) {
hours = Math.abs(24 - hours);
}
return "[" + hours + ":" + date.getMinutes() + "] ";
return "[" + (hours < 10 ? "0" + hours : hours) + ":" + (minutes < 10 ? "0" + minutes : minutes) + "] ";
}
}