Enforce a 2 digits time for hour, min and sec

This commit is contained in:
Romain Ariza
2020-05-27 23:23:18 +10:00
parent d8ea41fa41
commit 9e786108f9
+1 -1
View File
@@ -45,7 +45,7 @@ void printDataTime(){//used to print system time
timeinfo = localtime(&rawtime);//convert to local time
printf("%s \n",asctime(timeinfo));
lcdPosition(lcdhd,0,1);// set the LCD cursor position to (0,1)
lcdPrintf(lcdhd,"Time:%d:%d:%d",timeinfo->tm_hour,timeinfo->tm_min,timeinfo->tm_sec); //Display system time on LCD
lcdPrintf(lcdhd,"Time: %02d:%02d:%02d", timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec); //Display system time on LCD
}
int main(void){
int i;