| 178 | bool Timestamp::operator==(const Timestamp& t) const { return (m_secs == t.m_secs && m_usecs == t.m_usecs); } |
| 179 | |
| 180 | std::string Timestamp::Format(bool machine_friendly) const { |
| 181 | struct tm tm_time; |
| 182 | |
| 183 | time_t t = (time_t)getFloatTime(); |
| 184 | |
| 185 | #ifdef WIN32 |
| 186 | localtime_s(&tm_time, &t); |
| 187 | #else |
| 188 | localtime_r(&t, &tm_time); |
| 189 | #endif |
| 190 | |
| 191 | char buffer[128]; |
| 192 | |
| 193 | if (machine_friendly) { |
| 194 | strftime(buffer, 128, "%Y%m%d_%H%M%S", &tm_time); |
| 195 | } else { |
| 196 | strftime(buffer, 128, "%c", &tm_time); // Thu Aug 23 14:55:02 2001 |
| 197 | } |
| 198 | |
| 199 | return std::string(buffer); |
| 200 | } |
| 201 | |
| 202 | std::string Timestamp::Format(double s) { |
| 203 | int days = int(s / (24. * 3600.0)); |
nothing calls this directly
no outgoing calls
no test coverage detected