aboutsummaryrefslogtreecommitdiff
path: root/CPP/Windows/NationalTime.cpp
diff options
context:
space:
mode:
authorIgor Pavlov <87184205+ip7z@users.noreply.github.com>2021-12-27 00:00:00 +0000
committerIgor Pavlov <87184205+ip7z@users.noreply.github.com>2022-03-18 15:35:13 +0500
commitf19f813537c7aea1c20749c914e756b54a9c3cf5 (patch)
tree816ba62ca7c0fa19f2eb46d9e9d6f7dd7c3a744d /CPP/Windows/NationalTime.cpp
parent98e06a519b63b81986abe76d28887f6984a7732b (diff)
download7zip-21.07.tar.gz
7zip-21.07.tar.bz2
7zip-21.07.zip
'21.07'21.07
Diffstat (limited to 'CPP/Windows/NationalTime.cpp')
-rw-r--r--CPP/Windows/NationalTime.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/CPP/Windows/NationalTime.cpp b/CPP/Windows/NationalTime.cpp
new file mode 100644
index 0000000..0dcd31e
--- /dev/null
+++ b/CPP/Windows/NationalTime.cpp
@@ -0,0 +1,37 @@
1// Windows/NationalTime.cpp
2
3#include "StdAfx.h"
4
5#include "NationalTime.h"
6
7namespace NWindows {
8namespace NNational {
9namespace NTime {
10
11bool MyGetTimeFormat(LCID locale, DWORD flags, CONST SYSTEMTIME *time,
12 LPCTSTR format, CSysString &resultString)
13{
14 resultString.Empty();
15 int numChars = ::GetTimeFormat(locale, flags, time, format, NULL, 0);
16 if (numChars == 0)
17 return false;
18 numChars = ::GetTimeFormat(locale, flags, time, format,
19 resultString.GetBuf(numChars), numChars + 1);
20 resultString.ReleaseBuf_CalcLen(numChars);
21 return (numChars != 0);
22}
23
24bool MyGetDateFormat(LCID locale, DWORD flags, CONST SYSTEMTIME *time,
25 LPCTSTR format, CSysString &resultString)
26{
27 resultString.Empty();
28 int numChars = ::GetDateFormat(locale, flags, time, format, NULL, 0);
29 if (numChars == 0)
30 return false;
31 numChars = ::GetDateFormat(locale, flags, time, format,
32 resultString.GetBuf(numChars), numChars + 1);
33 resultString.ReleaseBuf_CalcLen(numChars);
34 return (numChars != 0);
35}
36
37}}}