mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 13:35:47 +00:00
Fixed output of various date/time stuff ($D and $T in prompt, %DATE% and %TIME% variables, DATE /T and TIME /T commands) to be more compatible with Windows.
svn path=/trunk/; revision=40050
This commit is contained in:
parent
80c1384089
commit
6f8ec7004e
8 changed files with 80 additions and 82 deletions
|
@ -134,7 +134,6 @@ INT cmd_time (LPTSTR param)
|
|||
LPTSTR *arg;
|
||||
INT argc;
|
||||
INT i;
|
||||
BOOL bPrompt = TRUE;
|
||||
INT nTimeString = -1;
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
|
@ -152,19 +151,25 @@ INT cmd_time (LPTSTR param)
|
|||
for (i = 0; i < argc; i++)
|
||||
{
|
||||
if (_tcsicmp (arg[i], _T("/t")) == 0)
|
||||
bPrompt = FALSE;
|
||||
{
|
||||
/* Display current time in short format */
|
||||
SYSTEMTIME st;
|
||||
TCHAR szTime[20];
|
||||
GetLocalTime(&st);
|
||||
FormatTime(szTime, &st);
|
||||
ConOutPuts(szTime);
|
||||
freep(arg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((*arg[i] != _T('/')) && (nTimeString == -1))
|
||||
nTimeString = i;
|
||||
}
|
||||
|
||||
if (nTimeString == -1)
|
||||
PrintTime ();
|
||||
|
||||
if (!bPrompt)
|
||||
{
|
||||
freep (arg);
|
||||
return 0;
|
||||
ConOutResPrintf(STRING_LOCALE_HELP1);
|
||||
ConOutPrintf(_T(": %s\n"), GetTimeString());
|
||||
}
|
||||
|
||||
while (1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue