Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(datastore): Ensure the datastore time is returned as UTC #3521

Merged
merged 10 commits into from Jan 13, 2021

Conversation

@crwilcox
Copy link
Collaborator

@crwilcox crwilcox commented Jan 11, 2021

No description provided.

datastore/load.go Outdated Show resolved Hide resolved
Loading
@@ -369,7 +369,7 @@ func setVal(v reflect.Value, p Property) (s string) {
if ok {
s := micros / 1e6
ns := micros % 1e6
v.Set(reflect.ValueOf(time.Unix(s, ns)))
v.Set(reflect.ValueOf(time.Unix(s, ns).In(time.UTC)))
Copy link
Collaborator

@tbpg tbpg Jan 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind adding a test that ensures the times are returned in UTC?

Loading

Copy link
Collaborator

@tritone tritone Jan 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, might be easier said than done though :)

Loading

Copy link
Collaborator Author

@crwilcox crwilcox Jan 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test added.

Loading

Copy link
Collaborator

@tritone tritone left a comment

Looks good.

Loading

datastore/load_test.go Outdated Show resolved Hide resolved
Loading
datastore/load_test.go Outdated Show resolved Hide resolved
Loading
datastore/load_test.go Outdated Show resolved Hide resolved
Loading
tbpg
tbpg approved these changes Jan 13, 2021
Copy link
Collaborator

@tbpg tbpg left a comment

Thanks!

Loading

@crwilcox crwilcox merged commit 0e659e2 into googleapis:master Jan 13, 2021
3 checks passed
Loading
@crwilcox crwilcox deleted the ensure-UTC branch Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants