Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
proposal: time: Parse time similar to fmt.Scanf and related functions #30373
In reference to #29911, with being unable to require a 24-hour hour zero-padded.
Perhaps we could have time formats provided similarly to fmt.Printf()?
It'd require reworking some things, but just on a whim, how does this sound?
The missing digits could easily be optional, too. It'd allow for very flexible formatting of date and time, in comparison to what we currently have.
External packages exist that recreate the behavior of C's strftime, which achieve what is asked for here. We deliberately chose to avoid that interface because of its unreadability and messiness, and are happy with that decision.
I suggest the requester use one of the community-provided packages. I also suggest giving the time package another chance: If you use the constants provided (time.UnixDate, time.Kitchen etc.) you rarely need to remember any details about how it works.