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

time: doc: be more explicit about how the reference date works #45830

Closed
earthboundkid opened this issue Apr 28, 2021 · 4 comments
Closed

time: doc: be more explicit about how the reference date works #45830

earthboundkid opened this issue Apr 28, 2021 · 4 comments
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@earthboundkid
Copy link
Contributor

It seems like the reference date, being a novel idea in Go's time package, is a stumbling block for developers new to Go. I think it's worth adding a paragraph to the documentation for Parse and Format that is extremely explicit. Something along the lines of:

The following values are recognized:

month: 1 01 Jan January
day: 2 02 _2
hour: 3 03 15
minute: 4 04
second: 5 05 05.0 (etc.)
year: 6 06 2006
timezone: -07 -0700 -07:00 MST
day of week: Mon Monday
meridiem: pm PM

@ianlancetaylor ianlancetaylor added Documentation NeedsFix The path to resolution is known, but the work has not been done. labels Apr 28, 2021
@ianlancetaylor ianlancetaylor added this to the Backlog milestone Apr 28, 2021
@ianlancetaylor
Copy link
Contributor

CC @robpike

@gopherbot
Copy link

Change https://golang.org/cl/315795 mentions this issue: time: provide a concrete example for Format() and Parse()

@nogurenn
Copy link

nogurenn commented May 1, 2021

@ianlancetaylor Hello. I'm not sure if I should ping here since I'm a first time contributor, but I've submitted a possible change in the documentation on gerrit.

EDIT: okay gopherbot is fast

@robpike
Copy link
Contributor

robpike commented May 1, 2021

The problem may be worth addressing; people do have trouble understanding the reference date (and that's on me).

I have an idea how to do this. Assigning to myself.

@robpike robpike self-assigned this May 1, 2021
@robpike robpike closed this as completed Oct 16, 2021
@rsc rsc unassigned robpike Jun 23, 2022
@golang golang locked and limited conversation to collaborators Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

5 participants