timestamp : Adjust hour print alignment format

This commit is contained in:
ottochen 2020-09-07 09:45:49 +08:00
parent 65758f351b
commit 9f6a1d319d

View file

@ -647,7 +647,7 @@ int tty_connect(void)
struct tm *tm;
gettimeofday(&tv, NULL);
tm = localtime(&tv.tv_sec);
sprintf(current_str, "[%-2d:%02d:%02d.%03ld] ", tm->tm_hour, tm->tm_min, tm->tm_sec, tv.tv_usec/1000);
sprintf(current_str, "[%2d:%02d:%02d.%03ld] ", tm->tm_hour, tm->tm_min, tm->tm_sec, tv.tv_usec/1000);
fprintf(stdout, ANSI_COLOR_GRAY "%s" ANSI_COLOR_RESET, current_str);
next_timestamp = 0;
if (option.log && option.timestamp)