MCPcopy Create free account
hub / github.com/AutonomousFieldRoboticsLab/SVIn / Format

Method Format

pose_graph/ThirdParty/DUtils/Timestamp.cpp:180–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178bool Timestamp::operator==(const Timestamp& t) const { return (m_secs == t.m_secs && m_usecs == t.m_usecs); }
179
180std::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
202std::string Timestamp::Format(double s) {
203 int days = int(s / (24. * 3600.0));

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected