I believe time.Local = time.UTC is the right approach. It is true that the 
loc field of the time structure will be set to &UTC and not zero, but I 
couldn't find a path where this should generate a problem. From my point of 
view I would regard any issue resulting from it as a bug.

Uli

On Thursday, October 28, 2021 at 4:05:00 AM UTC+2 Ian Lance Taylor wrote:

> On Wed, Oct 27, 2021 at 4:28 PM Radu Berinde <ra...@cockroachlabs.com> 
> wrote:
> >
> > > The argument here
> > is that a program would only call the UTC method if it wants to change
> > the way that those conversions work, so it presumably cares about the
> > wall time, not monotonic time.
> >
> > But in those contexts, the monotonic time wouldn't make a difference - 
> so what is the upside of stripping it? Are there cases I'm not seeing where 
> the mono time would interfere with these "standard" usage patterns?
>
> That's true, keeping the monotonic time wouldn't make much difference.
> Stripping it gives you consistent behavior with things like time.Sub,
> but I agree that it's not a major point. But I don't think we can
> really change the behavior now.
>
> Ian
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/e489b1b5-e42c-4a1e-aa91-4ffa644e5b48n%40googlegroups.com.

Reply via email to