fix a small bug, write out time like HH:MM:SS,ms as ms cmd does.

svn path=/trunk/; revision=16681
This commit is contained in:
Magnus Olsen 2005-07-21 16:28:20 +00:00
parent 0d62ee8f06
commit 58f5ef812e
3 changed files with 17 additions and 13 deletions

View file

@ -1036,7 +1036,10 @@ ProcessInput (BOOL bFlag)
else if (_tcsicmp(ip,_T("time")) ==0)
{
TCHAR szTime[40];
GetTimeFormat(LOCALE_USER_DEFAULT, 0, NULL, NULL, szTime, sizeof(szTime));
SYSTEMTIME t;
GetSystemTime(&t);
_sntprintf(szTime ,40,_T("%02d%c%02d%c%02d%c%02d"), t.wHour, cTimeSeparator,t.wMinute , cTimeSeparator,t.wSecond , cDecimalSeparator, t.wMilliseconds );
cp = _stpcpy (cp, szTime);
}

View file

@ -71,11 +71,11 @@ VOID PrintDate (VOID)
VOID PrintTime (VOID)
{
TCHAR szMsg[RC_STRING_MAX_SIZE];
TCHAR szTime[32];
GetTimeFormat(LOCALE_USER_DEFAULT, 0, NULL, NULL,
szTime, sizeof(szTime));
SYSTEMTIME t;
GetSystemTime(&t);
LoadString(CMD_ModuleHandle, STRING_LOCALE_HELP1, szMsg, RC_STRING_MAX_SIZE);
ConOutPrintf(_T("%s: %s\n"), szMsg, szTime);
ConOutPrintf(_T("%s: %02d%c%02d%c%02d%c%02d\n"), szMsg, t.wHour, cTimeSeparator,
t.wMinute , cTimeSeparator,
t.wSecond , cDecimalSeparator, t.wMilliseconds );
}

View file

@ -139,9 +139,10 @@ VOID PrintPrompt(VOID)
case _T('T'):
{
TCHAR szTime[32];
GetTimeFormat(LOCALE_USER_DEFAULT, 0, NULL, NULL,szTime, sizeof(szTime));
ConOutPrintf("%s",szTime);
SYSTEMTIME t;
GetSystemTime(&t);
ConOutPrintf(_T("%02d%c%02d%c%02d%c%02d\n"),t.wHour, cTimeSeparator,t.wMinute , cTimeSeparator,
t.wSecond , cDecimalSeparator, t.wMilliseconds );
}
break;