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

Unified Diff: base/time.h

Issue 10536061: Add Javascript time methods to base::Time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 | « no previous file | base/time.cc » ('j') | base/time.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/time.h
diff --git a/base/time.h b/base/time.h
index 5eac21567232f63db04e465105e7ccae62e70f8b..148727662344e5ea17cc4e79d8d9b8b5968d79b8 100644
--- a/base/time.h
+++ b/base/time.h
@@ -266,6 +266,12 @@ class BASE_EXPORT Time {
static Time FromDoubleT(double dt);
double ToDoubleT() const;
+ // Converts to/from the Javascript convention for times, a number of
+ // milliseconds since the epoch:
+ // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/getTime.
+ static Time FromJsTime(double ms_since_epoch);
+ double ToJsTime() const;
+
#if defined(OS_POSIX)
struct timeval ToTimeVal() const;
#endif
« no previous file with comments | « no previous file | base/time.cc » ('j') | base/time.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698