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: Go should support Dec 31, 23:59:05, 1999 as an alternative format date #9696

Closed
LaurieCheers opened this issue Jan 26, 2015 · 1 comment

Comments

Projects
None yet
3 participants
@LaurieCheers
Copy link

commented Jan 26, 2015

The current format reference date, Jan 2, 3:04:05pm 2006, is hard to remember (especially for those not accustomed to US date order). I suggest the formatting code should also accept Dec 31, 11:59:05pm, 1999. None of these numbers clash with the existing ones, so it's unambiguous to simply accept both.

Pro: Easy to remember, and easy for a reader to understand.

Con: Ok, so it doesn't indicate whether to pad single digits with a leading 0. I suggest the default should be "no padding" (except for minutes and 24-hour-clock hours). People who care about padding will have to switch back to the old encoding.

PS: Note that I left seconds as "05" - the number 59 is taken, and if we're going to have to pick an arbitrary number 05 seems as good as any. But hey, one arbitrary number seems far better than six of them.

@bradfitz

This comment has been minimized.

Copy link
Member

commented Jan 26, 2015

This will only add to the required amounts of documentation, learning required, and confusion overall (e.g. when reading other people's code).

You're welcome to write your own time formatting package elsewhere. There's nothing special about Go's except that it's in the time package already. Nobody has to use it if it's so confusing. But let's not make it more confusing.

@bradfitz bradfitz closed this Jan 26, 2015

@mikioh mikioh changed the title Go should support Dec 31, 23:59:05, 1999 as an alternative format date time: Go should support Dec 31, 23:59:05, 1999 as an alternative format date Jan 26, 2015

@golang golang locked and limited conversation to collaborators Jun 25, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.