Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
time: Go should support Dec 31, 23:59:05, 1999 as an alternative format date #9696
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.
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.