3swordman 4 лет назад
Родитель
Сommit
77ba76a65b
2 измененных файлов с 8 добавлено и 2 удалено
  1. 1 1
      include/vcc/version.h
  2. 7 1
      pretty.c

+ 1 - 1
include/vcc/version.h

@@ -1,2 +1,2 @@
-#define VCCD_VERSION "vccd 1.3.0 2022年 03月 20日 星期日 17:05:54 CST root"
+#define VCCD_VERSION "vccd 1.3.0 Sun 20 Mar 2022 07:36:32 PM CST ubuntu"
 #define VCCD_SYMVER "vcc 1.3.0-rc "

+ 7 - 1
pretty.c

@@ -21,6 +21,7 @@
 
 #include <stdio.h>
 #include <string.h>
+#include <time.h>
 #include <sys/times.h>
 
 #include <vcc/vcc.h>
@@ -91,10 +92,15 @@ struct theme *current_theme = &theme_def;
 
 
 int pretty_new_msg(char *usrname, char *buf) {
+	time_t time_now;
+	struct tm *tm_now;
+
 	ansi_csi_st(stdout, MODE_HIGHLIGHT, FG_BLACK, BG_BLACK);
 
 	setcolor(stdout, curr_time);
-	printf("\r[%ld] ", times(NULL));
+	time_now = time(NULL);
+	tm_now = localtime(&time_now);
+	printf("\r[%02d:%02d] ", tm_now->tm_hour, tm_now->tm_min);
 
 	if (unlikely(!strcmp(usrname, "system"))) {
 		setcolor(stdout, curr_sysusername);