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

Unified Diff: service/datastore/properties.go

Issue 1550903002: impl/memory: Fix time serialization encoding. (Closed) Base URL: https://github.com/luci/gae@master
Patch Set: Move logic to serialize, add blobstore.Key support. Created 5 years 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
Index: service/datastore/properties.go
diff --git a/service/datastore/properties.go b/service/datastore/properties.go
index d82118dbe77eee6c75db7ddb90f0fd227f635e8f..a81b0ee3652075464b28934197903fecfc9f7c31 100644
--- a/service/datastore/properties.go
+++ b/service/datastore/properties.go
@@ -245,6 +245,12 @@ func PropertyTypeOf(v interface{}, checkValid bool) (PropertyType, error) {
}
}
+// RoundTime rounds a time.Time to microseconds, which is the (undocumented)
+// way that the AppEngine SDK stores it.
+func RoundTime(t time.Time) time.Time {
dnj 2015/12/29 21:40:47 I'm adding this and exporting it b/c this is somet
+ return t.Round(time.Microsecond)
+}
+
// timeLocationIsUTC tests if two time.Location are equal.
//
// This is tricky using the standard time API, as time is implicitly normalized

Powered by Google App Engine
This is Rietveld 408576698