From 24a38b34ed1bd335fb2d9dede30f36757c3d79e8 Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Tue, 9 Jul 2024 20:50:51 +0900 Subject: [PATCH] [CMD] DATE: Simply use short date without weekday (#7116) JIRA issue: CORE-13848 Simply use the result of GetDateFormat function in %DATE% environment variable and the DATE command. --- base/shell/cmd/locale.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/base/shell/cmd/locale.c b/base/shell/cmd/locale.c index d2ab3d13a89..a2ec1167758 100644 --- a/base/shell/cmd/locale.c +++ b/base/shell/cmd/locale.c @@ -53,18 +53,15 @@ VOID InitLocale(VOID) #endif } -/* Return date string including weekday. Used for $D in prompt and %DATE% */ +/* Return date string without weekday. Used for $D in prompt and %DATE% */ LPTSTR GetDateString(VOID) { static TCHAR szDate[32]; SYSTEMTIME t; - INT len; - GetLocalTime(&t); - len = GetDateFormat(LOCALE_USER_DEFAULT, 0, &t, _T("ddd"), szDate, ARRAYSIZE(szDate)); - szDate[len - 1] = _T(' '); - FormatDate(&szDate[len], &t, TRUE); + GetLocalTime(&t); + GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &t, NULL, szDate, ARRAYSIZE(szDate)); return szDate; }