Changeset e46ad71 in nscp


Ignore:
Timestamp:
11/10/07 09:37:53 (6 years ago)
Author:
Michael Medin <michael@…>
Branches:
master, 0.4.0, 0.4.1, 0.4.2, stable
Children:
860f310
Parents:
3ece2bd
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • include/strEx.h

    r478588b re46ad71  
    4242  inline std::string format_date(time_t time, std::string format) { 
    4343    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) 
    4647      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); 
    4854    if (l <= 0 || l >= 50) 
    4955      return ""; 
Note: See TracChangeset for help on using the changeset viewer.