------------------------------------------------------------------------------ Get current date, format is m-d-y
| 148 | //------------------------------------------------------------------------------ |
| 149 | // Get current date, format is m-d-y |
| 150 | const std::string |
| 151 | GetCurrentDate() |
| 152 | { |
| 153 | time_t now = time(0); |
| 154 | struct tm tstruct; |
| 155 | char buf[80]; |
| 156 | |
| 157 | #if !defined(_WIN32) || defined(__CYGWIN__) |
| 158 | tstruct = *localtime(&now); |
| 159 | #else |
| 160 | localtime_s(&tstruct, &now); |
| 161 | #endif |
| 162 | |
| 163 | // Visit http://www.cplusplus.com/reference/clibrary/ctime/strftime/ |
| 164 | // for more information about date/time format |
| 165 | strftime(buf, sizeof(buf), "%m-%d-%y", &tstruct); |
| 166 | |
| 167 | return buf; |
| 168 | } |
| 169 | |
| 170 | |
| 171 | //------------------------------------------------------------------------------ |