MCPcopy Create free account
hub / github.com/derceg/explorerplusplus / CreateSystemTimeString

Function CreateSystemTimeString

Explorer++/Helper/Helper.cpp:40–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40BOOL CreateSystemTimeString(const SYSTEMTIME *localSystemTime,
41 TCHAR *szBuffer, size_t cchMax, BOOL bFriendlyDate)
42{
43 if (bFriendlyDate)
44 {
45 BOOL ret = CreateFriendlySystemTimeString(localSystemTime, szBuffer, cchMax);
46
47 if (ret)
48 {
49 return TRUE;
50 }
51 }
52
53 TCHAR dateBuffer[512];
54 int iReturn1 = GetDateFormat(LOCALE_USER_DEFAULT, LOCALE_USE_CP_ACP, localSystemTime,
55 NULL, dateBuffer, SIZEOF_ARRAY(dateBuffer));
56
57 TCHAR timeBuffer[512];
58 int iReturn2 = GetTimeFormat(LOCALE_USER_DEFAULT, LOCALE_USE_CP_ACP, localSystemTime,
59 NULL, timeBuffer, SIZEOF_ARRAY(timeBuffer));
60
61 if ((iReturn1 != 0) && (iReturn2 != 0))
62 {
63 StringCchPrintf(szBuffer, cchMax, _T("%s %s"), dateBuffer, timeBuffer);
64 return TRUE;
65 }
66
67 return FALSE;
68}
69
70BOOL CreateFriendlySystemTimeString(const SYSTEMTIME *localSystemTime,
71 TCHAR *szBuffer, size_t cchMax)

Callers 2

CreateFileTimeStringFunction · 0.85

Calls 1

Tested by

no test coverage detected