85 { |
93 { |
86 std::ostringstream os; |
94 std::ostringstream os; |
87 #ifdef WIN32 |
95 #ifdef WIN32 |
88 SYSTEMTIME time; |
96 SYSTEMTIME time; |
89 GetSystemTime(&time); |
97 GetSystemTime(&time); |
90 #if defined(_MSC_VER) && (_MSC_VER < 1500) |
98 char buf1[11], buf2[9], buf3[5]; |
91 LPWSTR buf1, buf2, buf3; |
99 if (GetDateFormat(MY_LOCALE, 0, &time, |
92 if (GetDateFormat(LOCALE_USER_DEFAULT, 0, &time, |
100 ("ddd MMM dd"), buf1, 11) && |
93 L"ddd MMM dd", buf1, 11) && |
101 GetTimeFormat(MY_LOCALE, 0, &time, |
94 GetTimeFormat(LOCALE_USER_DEFAULT, 0, &time, |
102 ("HH':'mm':'ss"), buf2, 9) && |
95 L"HH':'mm':'ss", buf2, 9) && |
103 GetDateFormat(MY_LOCALE, 0, &time, |
96 GetDateFormat(LOCALE_USER_DEFAULT, 0, &time, |
104 ("yyyy"), buf3, 5)) { |
97 L"yyyy", buf3, 5)) { |
|
98 os << buf1 << ' ' << buf2 << ' ' << buf3; |
105 os << buf1 << ' ' << buf2 << ' ' << buf3; |
99 } |
106 } |
100 #else |
|
101 char buf1[11], buf2[9], buf3[5]; |
|
102 if (GetDateFormat(LOCALE_USER_DEFAULT, 0, &time, |
|
103 "ddd MMM dd", buf1, 11) && |
|
104 GetTimeFormat(LOCALE_USER_DEFAULT, 0, &time, |
|
105 "HH':'mm':'ss", buf2, 9) && |
|
106 GetDateFormat(LOCALE_USER_DEFAULT, 0, &time, |
|
107 "yyyy", buf3, 5)) { |
|
108 os << buf1 << ' ' << buf2 << ' ' << buf3; |
|
109 } |
|
110 #endif |
|
111 else os << "unknown"; |
107 else os << "unknown"; |
112 #else |
108 #else |
113 timeval tv; |
109 timeval tv; |
114 gettimeofday(&tv, 0); |
110 gettimeofday(&tv, 0); |
115 |
111 |