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

proposal: expose time.Location extend string for zone transitions #68367

Open
jaesung9507 opened this issue Jul 10, 2024 · 7 comments
Open

proposal: expose time.Location extend string for zone transitions #68367

jaesung9507 opened this issue Jul 10, 2024 · 7 comments
Labels
Milestone

Comments

@jaesung9507
Copy link

Proposal Details

When zoneinfo is needed, it is parsed from the files in the /usr/share/zoneinfo/ directory.
This implementation works only on Unix systems.
I recently discovered that this value is stored in the extend field of the time.Location struct.
I use this value to send to other devices.

I propose adding a getter function to retrieve this value:

func (l *Location) Extend() string

@gopherbot gopherbot added this to the Proposal milestone Jul 10, 2024
@seankhliao
Copy link
Member

why is it necessary to expose this data? and from the looks of it, just extends is insufficient to describe all the time zone transitions correctly?

@jaesung9507
Copy link
Author

@seankhliao
This value is used to transmit this value to IoT devices that do not have time zone information.
Why not simply provide this value to those who need it?

@seankhliao
Copy link
Member

I don't think that's sufficient information to capture zone transitions, exposing it doesn't seem appropriate if it's incomplete.

@seankhliao seankhliao changed the title proposal: Add getter of extend from time.Location proposal: expose time.Location extend string for zone transitions Jul 10, 2024
@ianlancetaylor
Copy link
Member

I agree that just the extend string is not enough to handle timezone transitions. It only predicts future transitions, it doesn't cover past ones.

In any case this seems like something that belongs more in a third party library.

@ianlancetaylor ianlancetaylor moved this to Incoming in Proposals Jul 10, 2024
@jaesung9507
Copy link
Author

I understand that the extend string may not capture all zone transitions comprehensively. However, the ability to predict future transitions still holds significant value.

While it is true that the extend string focuses on future transitions and may not cover past ones, this limitation can be clearly documented.

@shubhamgoyal1402
Copy link

To provide zone info to the device, do we have to display the current zone location ?

@Sec32fun32
Copy link

Varsayılan bölge olarak

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Incoming
Development

No branches or pull requests

6 participants