Convert time point 't' into date-time string at precision 'p'. Output string is in UTC time zone if 'utc' is true, else it is in the local time zone.
| 99 | // Output string is in UTC time zone if 'utc' is true, else it is in the |
| 100 | // local time zone. |
| 101 | static string ToString(const chrono::system_clock::time_point& t, TimePrecision p, |
| 102 | bool utc) { |
| 103 | stringstream ss; |
| 104 | time_t second = GetSecond(t); |
| 105 | int64_t subsecond = GetSubSecond(t, p); |
| 106 | ss << FormatSecond(second, subsecond, utc); |
| 107 | ss << FormatSubSecond(subsecond, p); |
| 108 | return ss.str(); |
| 109 | } |
| 110 | |
| 111 | // Convenience function to convert Unix time, specified as seconds since |
| 112 | // the Unix epoch, into a C++ time_point object. |
no test coverage detected