mirror of
https://github.com/reactos/reactos.git
synced 2025-04-28 01:11:35 +00:00
[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.
This commit is contained in:
parent
050b3ad2ca
commit
24a38b34ed
1 changed files with 3 additions and 6 deletions
|
@ -53,18 +53,15 @@ VOID InitLocale(VOID)
|
||||||
#endif
|
#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
|
LPTSTR
|
||||||
GetDateString(VOID)
|
GetDateString(VOID)
|
||||||
{
|
{
|
||||||
static TCHAR szDate[32];
|
static TCHAR szDate[32];
|
||||||
SYSTEMTIME t;
|
SYSTEMTIME t;
|
||||||
INT len;
|
|
||||||
GetLocalTime(&t);
|
|
||||||
|
|
||||||
len = GetDateFormat(LOCALE_USER_DEFAULT, 0, &t, _T("ddd"), szDate, ARRAYSIZE(szDate));
|
GetLocalTime(&t);
|
||||||
szDate[len - 1] = _T(' ');
|
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &t, NULL, szDate, ARRAYSIZE(szDate));
|
||||||
FormatDate(&szDate[len], &t, TRUE);
|
|
||||||
return szDate;
|
return szDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue