mirror of
https://github.com/moparisthebest/Yaaic
synced 2025-02-16 15:00:14 -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();
|
Date date = new Date();
|
||||||
|
|
||||||
int hours = date.getHours();
|
int hours = date.getHours();
|
||||||
|
int minutes = date.getMinutes();
|
||||||
|
|
||||||
if (!use24hFormat) {
|
if (!use24hFormat) {
|
||||||
hours = Math.abs(24 - hours);
|
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