如何阻止整数在时间中丢弃零?我试过用
String.format("%02d", minutes);
但它不起作用,我相信它很简单!
Date dt = new Date();
int hours = dt.getHours();
int minutes = dt.getMinutes();
String curTime = hours + ":" + minutes;
String.format("%02d", minutes);
updatedat.setText("Updated at " + curTime);