Changeset 88e8240 in nscp
- Timestamp:
- 11/10/07 09:37:53 (6 years ago)
- Children:
- d2394a2
- Parents:
- bf3d4f2
- File:
-
- 1 edited
-
trunk/include/strEx.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/strEx.h
r484be40 r88e8240 42 42 inline std::string format_date(time_t time, std::string format) { 43 43 char buf[51]; 44 struct tm nt; 45 if (gmtime_s(&nt, &time) != 0) 44 struct tm *nt = new struct tm; 45 #if (_MSC_VER < 1300) // 1300 == VC++ 7.0 46 if (gmtime_s(nt, &time) != 0) 46 47 return ""; 47 size_t l = strftime(buf, 50, format.c_str(), &nt); 48 #else 49 nt = gmtime(&time); 50 if (nt == NULL) 51 return ""; 52 #endif 53 size_t l = strftime(buf, 50, format.c_str(), nt); 48 54 if (l <= 0 || l >= 50) 49 55 return "";
Note: See TracChangeset
for help on using the changeset viewer.








