You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
(_ specifies a missing digit)
%_h - _ length 12 hour zero-padded hour
%_H - _ length 24 hour zero-padded hour
%_m - _ length zero-padded minute
%_s - _ length zero-padded second
%_D - _ length zero-padded days
%_M - _ length zero-padded months
%_Y - _ length zero-padded years
now, this is where the naming convention started feeling shaky.
I figured W since it's an upside-down m, and could still say "word".
But, day, I struggled with. This is where I'd like suggestions, because C does not feel fitting at all, and was more of a placeholder if anything.
%w - 3-letter month word (Ex. Jan)
%W - full month word (Ex. January)
%c - 3-letter day word (Ex. Mon)
%C - full day word (Ex. Monday)
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.
The text was updated successfully, but these errors were encountered:
Riven-Spell
changed the title
proposal: Change how time is parsed to be more similar to fmt.Printf and related functions
proposal: time: Change how time is parsed to be more similar to fmt.Printf and related functions
Feb 24, 2019
Riven-Spell
changed the title
proposal: time: Change how time is parsed to be more similar to fmt.Printf and related functions
proposal: time: Change how time is parsed to be more similar to fmt.Scanf and related functions
Feb 24, 2019
Riven-Spell
changed the title
proposal: time: Change how time is parsed to be more similar to fmt.Scanf and related functions
proposal: time: Parse time similar to fmt.Scanf and related functions
Feb 24, 2019
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.
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?
(_ specifies a missing digit)
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.
The text was updated successfully, but these errors were encountered: