mirror of
https://github.com/moparisthebest/Yaaic
synced 2024-11-22 17:02:21 -05:00
Fixed timestamp. Prefix number with 0 if they are < 10
This commit is contained in:
parent
2d585d6a72
commit
5140646fd4
@ -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) + "] ";
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user