Open gbjk opened 1 month ago
Attention: Patch coverage is 67.68293%
with 106 lines
in your changes missing coverage. Please review.
Project coverage is 37.99%. Comparing base (
98f025e
) to head (c6decee
). Report is 1 commits behind head on master.:exclamation: Current head c6decee differs from pull request most recent head 9aa913e
Please upload reports for the commit 9aa913e to get more accurate results.
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. I raised this 2 months ago and agreed UTC internal and Local external (in this thread](https://gocryptotrader.slack.com/archives/C05QQD37JBG/p1711776611515419?thread_ts=1711764832.429979&cid=C05QQD37JBG)
Happy to validate the thinking though. Internal times for server apps are normally UTC because:
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 gctcli
), everything would have to adhere to this rule though. Comments should also explicility be modified to mention that it's UTC. Local times should also be inputted on client facing apps like gctcli and then converted to UTC behind the scenes to make it human friendly and vice versa.
Rebased on master
This fixes timestamps returning in Local TZ.
Type of change
How has this been tested