Converts the given epoch time in milliseconds to a date string in the ISO 8601 format, without the timezone information.
| 5012 | // Converts the given epoch time in milliseconds to a date string in the ISO |
| 5013 | // 8601 format, without the timezone information. |
| 5014 | std::string FormatEpochTimeInMillisAsIso8601(TimeInMillis ms) { |
| 5015 | struct tm time_struct; |
| 5016 | if (!PortableLocaltime(static_cast<time_t>(ms / 1000), &time_struct)) |
| 5017 | return ""; |
| 5018 | // YYYY-MM-DDThh:mm:ss |
| 5019 | return StreamableToString(time_struct.tm_year + 1900) + "-" + |
| 5020 | String::FormatIntWidth2(time_struct.tm_mon + 1) + "-" + |
| 5021 | String::FormatIntWidth2(time_struct.tm_mday) + "T" + |
| 5022 | String::FormatIntWidth2(time_struct.tm_hour) + ":" + |
| 5023 | String::FormatIntWidth2(time_struct.tm_min) + ":" + |
| 5024 | String::FormatIntWidth2(time_struct.tm_sec); |
| 5025 | } |
| 5026 | |
| 5027 | // Streams an XML CDATA section, escaping invalid CDATA sequences as needed. |
| 5028 | void XmlUnitTestResultPrinter::OutputXmlCDataSection(::std::ostream* stream, |
no test coverage detected