| 152 | } |
| 153 | |
| 154 | std::string timestamp(const std::string & format) { |
| 155 | auto now = std::time(nullptr); |
| 156 | #ifdef SIBR_OS_WINDOWS |
| 157 | tm ltm = { 0,0,0,0,0,0,0,0,0 }; |
| 158 | localtime_s(<m, &now); |
| 159 | #else |
| 160 | tm ltm = *(std::localtime(&now)); |
| 161 | #endif |
| 162 | std::stringstream buffer; |
| 163 | buffer << std::put_time(<m, format.c_str()); |
| 164 | return buffer.str(); |
| 165 | } |
| 166 | |
| 167 | } // namespace sirb |
| 168 |