Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(435)

Unified Diff: tracing/tracing/base/utils.html

Issue 2162963002: [polymer] Merge of master into polymer10-migration (Closed) Base URL: git@github.com:catapult-project/catapult.git@polymer10-migration
Patch Set: Merge polymer10-migration int polymer10-merge Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tracing/tracing/base/statistics_test.html ('k') | tracing/tracing/base/utils_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/base/utils.html
diff --git a/tracing/tracing/base/utils.html b/tracing/tracing/base/utils.html
index 1a98cab405281edc4a66e559a9e88aeaab0b0eac..5c9693473737cb714f4b1bb67ac2dd5491895596 100644
--- a/tracing/tracing/base/utils.html
+++ b/tracing/tracing/base/utils.html
@@ -116,6 +116,18 @@ tr.exportTo('tr.b', function() {
return undefined;
}
+ /**
+ * Format date as a string "YYYY-MM-DD HH:mm:ss". The timezone is implicitly
+ * UTC. This format is based on the ISO format, but without milliseconds and
+ * the 'T' is replaced with a space for legibility.
+ *
+ * @param {!Date} date
+ * @return {string}
+ */
+ function formatDate(date) {
+ return date.toISOString().replace('T', ' ').slice(0, 19);
+ }
+
return {
addSingletonGetter: addSingletonGetter,
@@ -124,6 +136,7 @@ tr.exportTo('tr.b', function() {
normalizeException: normalizeException,
stackTrace: stackTrace,
stackTraceAsString: stackTraceAsString,
+ formatDate: formatDate,
getUsingPath: getUsingPath
};
« no previous file with comments | « tracing/tracing/base/statistics_test.html ('k') | tracing/tracing/base/utils_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698