Re: [go-nuts] Golang application local timezone doesn't change with the system timezone

2022-03-02 Thread Roland Müller
Hello, Am Mi., 2. März 2022 um 09:48 Uhr schrieb Brian Candler : > On Tuesday, 1 March 2022 at 22:54:35 UTC carl...@gmail.com wrote: > >> If I had running services written in Go, they would not be aware of the >> timezone change. >> > > I think the current behaviour is reasonable, because it's

Re: [go-nuts] Golang application local timezone doesn't change with the system timezone

2022-03-01 Thread Brian Candler
On Tuesday, 1 March 2022 at 22:54:35 UTC carl...@gmail.com wrote: > If I had running services written in Go, they would not be aware of the > timezone change. > I think the current behaviour is reasonable, because it's rare that a running, persistent *service* needs to know of a change of the

Re: [go-nuts] Golang application local timezone doesn't change with the system timezone

2022-03-01 Thread Carl Menezes
Thanks. Makes sense. Cheers, Carl On Wed, Mar 2, 2022 at 1:09 PM Ian Lance Taylor wrote: > On Tue, Mar 1, 2022 at 4:05 PM Carl wrote: > > > > I'm interested in the reason for the current behaviour. > > I know there are ways to work around it and am aware of the consequences > of a change to

Re: [go-nuts] Golang application local timezone doesn't change with the system timezone

2022-03-01 Thread Ian Lance Taylor
On Tue, Mar 1, 2022 at 4:05 PM Carl wrote: > > I'm interested in the reason for the current behaviour. > I know there are ways to work around it and am aware of the consequences of a > change to the stdlib now. > I'm also aware of what will happen if the timezone changes on a standard > system.

Re: [go-nuts] Golang application local timezone doesn't change with the system timezone

2022-03-01 Thread Robert Engels
Yea - argument doesn’t hold much water. Log files either use timezonr agnostic times or the users know they will change if the time zone changes. > On Mar 1, 2022, at 6:05 PM, Carl wrote: > > I'm interested in the reason for the current behaviour. > I know there are ways to work around it

Re: [go-nuts] Golang application local timezone doesn't change with the system timezone

2022-03-01 Thread Carl
I'm interested in the reason for the current behaviour. I know there are ways to work around it and am aware of the consequences of a change to the stdlib now. I'm also aware of what will happen if the timezone changes on a standard system. I assume all platforms that Go supports support the

Re: [go-nuts] Golang application local timezone doesn't change with the system timezone

2022-03-01 Thread Robert Engels
Have a background routine that polls the os every N secs - but the OP can do that themselves. > On Mar 1, 2022, at 5:32 PM, Kurtis Rader wrote: > >  >> On Tue, Mar 1, 2022 at 2:55 PM Carl wrote: > >> I would like to understand the reasoning for the implementation, if >> possible. >> >>

Re: [go-nuts] Golang application local timezone doesn't change with the system timezone

2022-03-01 Thread Kurtis Rader
On Tue, Mar 1, 2022 at 2:55 PM Carl wrote: > I would like to understand the reasoning for the implementation, if > possible. > > Simple example: > I have a laptop running Ubuntu (or any other popular Linux distro). > I fly from New Zealand to Los Angeles > I open my laptop and change the

Re: [go-nuts] Golang application local timezone doesn't change with the system timezone

2022-03-01 Thread Kurtis Rader
On Tue, Mar 1, 2022 at 2:55 PM Carl wrote: > I would like to understand the reasoning for the implementation, if > possible. > > Simple example: > I have a laptop running Ubuntu (or any other popular Linux distro). > I fly from New Zealand to Los Angeles > I open my laptop and change the

Re: [go-nuts] Golang application local timezone doesn't change with the system timezone

2022-03-01 Thread Carl
I would like to understand the reasoning for the implementation, if possible. Simple example: I have a laptop running Ubuntu (or any other popular Linux distro). I fly from New Zealand to Los Angeles I open my laptop and change the timezone via the system GUI (which under the hood uses

Re: [go-nuts] Golang application local timezone doesn't change with the system timezone

2022-02-10 Thread E Z
I find a way to work around. The goal is to get the valid timezone of the system periodically in my application, So I try to get the valid timezone name from the file /etc/timezone and then parse it to the necessary object I need, to avoid accessing the file too often, I add a cache for the

Re: [go-nuts] Golang application local timezone doesn't change with the system timezone

2022-02-09 Thread Ian Lance Taylor
On Wed, Feb 9, 2022 at 3:37 PM E Z wrote: > > I noticed a phenomenon while maintaining my golang application, the local > timezone of the application always keep the value when it starts, the local > timezone will not change even though I change the system timezone. It looks > like the golang

Re: [go-nuts] Golang application local timezone doesn't change with the system timezone

2022-02-09 Thread Matthew Walster
On Wed, 9 Feb 2022 at 23:36, E Z wrote: > I noticed a phenomenon while maintaining my golang application, the local > timezone of the application always keep the value when it starts, the local > timezone will not change even though I change the system timezone. It looks > like the golang time

[go-nuts] Golang application local timezone doesn't change with the system timezone

2022-02-09 Thread E Z
I noticed a phenomenon while maintaining my golang application, the local timezone of the application always keep the value when it starts, the local timezone will not change even though I change the system timezone. It looks like the golang time package has been caching the current timezone.