MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / formatDate

Function formatDate

app/src/Sessions/HtmlReport.cpp:123–137  ·  view source on GitHub ↗

* @brief Re-formats an ISO 8601 timestamp in the DB Explorer's display style. */

Source from the content-addressed store, hash-verified

121 * @brief Re-formats an ISO 8601 timestamp in the DB Explorer's display style.
122 */
123static QString formatDate(const QString& iso)
124{
125 if (iso.isEmpty())
126 // code-verify off
127 return QStringLiteral("—");
128 // code-verify on
129
130 const auto dt = QDateTime::fromString(iso, Qt::ISODate);
131 if (!dt.isValid())
132 return iso;
133
134 // code-verify off
135 return dt.toString(QStringLiteral("MMM d, yyyy — h:mm:ss AP"));
136 // code-verify on
137}
138
139//--------------------------------------------------------------------------------------------------
140// Constructor & destructor

Callers 2

buildCoverSectionMethod · 0.85
buildMetadataSectionMethod · 0.85

Calls 2

isEmptyMethod · 0.80
isValidMethod · 0.45

Tested by

no test coverage detected