Skip to content

time: Go should support Dec 31, 23:59:05, 1999 as an alternative format date #9696

@LaurieCheers

Description

@LaurieCheers

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions