Chromium Code Reviews

Unified Diff: impl/prod/raw_datastore_type_converter.go

Issue 1345043005: Fix zero time bug (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « no previous file | impl/prod/raw_datastore_type_converter_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: impl/prod/raw_datastore_type_converter.go
diff --git a/impl/prod/raw_datastore_type_converter.go b/impl/prod/raw_datastore_type_converter.go
index e249e4877974894607257172bcf4adf2017665d9..fbeff38218a25d97f5cafaec6e5525ba6891550a 100644
--- a/impl/prod/raw_datastore_type_converter.go
+++ b/impl/prod/raw_datastore_type_converter.go
@@ -113,7 +113,11 @@ func dsR2FProp(in datastore.Property) (ds.Property, error) {
val = ds.GeoPoint(x)
case time.Time:
// "appengine" layer instantiates with Local timezone.
- val = x.UTC()
+ if x.IsZero() {
+ val = time.Time{}
+ } else {
+ val = x.UTC()
+ }
default:
val = maybeIndexValue(val)
}
« no previous file with comments | « no previous file | impl/prod/raw_datastore_type_converter_test.go » ('j') | no next file with comments »

Powered by Google App Engine