From 4ce63659fc6e4ceb1dd4a81f566514737f5a2408 Mon Sep 17 00:00:00 2001 From: Rintim Date: Wed, 20 Jan 2021 23:07:18 +0800 Subject: [PATCH] [2021/01/20-Inchar] Time's format --- source/core/ui/ui.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/source/core/ui/ui.c b/source/core/ui/ui.c index 9bfd34d..69cb09e 100644 --- a/source/core/ui/ui.c +++ b/source/core/ui/ui.c @@ -158,8 +158,16 @@ static void ui_draw_top(ui_view* ui) { screen_draw_string(verText, topScreenTopBarX + 2, topScreenTopBarY + (topScreenTopBarHeight - verHeight) / 2, 0.5f, 0.5f, COLOR_TEXT, true); time_t t = time(NULL); - char* timeText = ctime(&t); - timeText[strlen(timeText) - 1] = '\0'; + + + //char* timeText = ctime(&t); + char timeText[160]; + struct tm * timeinfo; + timeinfo = localtime(&t); + strftime(timeText,160,"%Y/%m/%d %H:%M:%S\0",timeinfo); + + + //timeText[strlen(timeText) - 1] = '\0'; float timeTextWidth; float timeTextHeight;