-
Notifications
You must be signed in to change notification settings - Fork 822
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
Common: Return UTC TZ time.Time from convert functions #1551
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1551 +/- ##
==========================================
+ Coverage 36.26% 37.99% +1.72%
==========================================
Files 419 415 -4
Lines 183133 153253 -29880
==========================================
- Hits 66421 58231 -8190
+ Misses 108605 86933 -21672
+ Partials 8107 8089 -18
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only issue I have with this change is consistency and can lead to a bit of confusion take gateio package gateioTime struct for example this will have local time variables as well and any time.Unix handling also. So the entire library will need to be updated to this standard. I have tended to keep everything local and push UTC to the boundary or when it's needed e.g. gRPC and rest calls or kline package. Unless there is some serious implications that I am unaware of which might well be, that is my only concern.
You're right, we need to consistency everywhere. Happy to validate the thinking though.
So we should have one of two PRs:
I couldn't find anyone arguing for Local over UTC in a quick google. I don't believe I introduced any confirmation bias. Unless you object I'll follow path (1) and ensure we're universally UTC until user facing exits, which should be localised. That includes sending UTC to any grpc clients other than GCT itself. |
Thanks for the context, I do see your point, I don't mind as long as it's consistent, but you got to take into account the overhaul of all time implementations to adhere to that standard. At the end of the day with all my time variables any sort of outbound data I will tack on a .UTC(), I usually don't assume time.Time is any standard at any time and won't assume even after this potential update. @thrasher- @gloriousCode Thoughts? |
Agree with UTC internal and local external (like |
eb60ba9
to
824ea44
Compare
d809ed6
to
b251971
Compare
All parsed times should be in UTC
Duplicate of convert_test.go TestTimeFromUnixTimestampDecimal
Doesn't seem like this will matter, but unifying all internal times to UTC
c6decee
to
9aa913e
Compare
Rebased on master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. There is a test failure in the CI builds for GetServerTime
but it seems intermittent and not due to this PR. tACK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this to be merged, we also need a way to enforce this across the codebase so that new local time usage won't be introduced
This PR is stale because it has been open 30 days with no activity. Please provide an update on the progress of this PR. |
This fixes timestamps returning in Local TZ.
Type of change
How has this been tested