Index: base/time/time.cc |
diff --git a/base/time/time.cc b/base/time/time.cc |
index 5f495e3f1e57002a33c5b241d9828e8d2884a641..b41941eb1215383c1c1695f116344ca122c9a1f1 100644 |
--- a/base/time/time.cc |
+++ b/base/time/time.cc |
@@ -138,6 +138,18 @@ double Time::ToJsTime() const { |
kMicrosecondsPerMillisecond); |
} |
+int64 Time::ToJavaTime() const { |
Mark Mentovai
2013/09/20 15:46:25
It looks like, given this and ToJsTime’s equivalen
apiccion
2013/09/20 18:21:48
Thank you!
On 2013/09/20 15:46:25, Mark Mentovai
|
+ if (is_null()) { |
+ return 0; |
Mark Mentovai
2013/09/20 15:46:25
You seem to have copied this from ToJsTime, but yo
apiccion
2013/09/20 18:21:48
Done.
|
+ } |
+ if (is_max()) { |
+ // Preserve max without offset to prevent overflow. |
+ return std::numeric_limits<long>::max(); |
Mark Mentovai
2013/09/20 15:46:25
long is the wrong type here.
apiccion
2013/09/20 18:21:48
Done.
|
+ } |
+ return ((us_ - kTimeTToMicrosecondsOffset) / |
+ kMicrosecondsPerMillisecond); |
+} |
+ |
// static |
Time Time::UnixEpoch() { |
Time time; |