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

proposal: time: new predefined layouts #59100

Closed
nemre opened this issue Mar 17, 2023 · 3 comments
Closed

proposal: time: new predefined layouts #59100

nemre opened this issue Mar 17, 2023 · 3 comments
Labels
FrozenDueToAge Proposal WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@nemre
Copy link

nemre commented Mar 17, 2023

Currently, time package have this predefined layouts;

Layout      = "01/02 03:04:05PM '06 -0700" // The reference time, in numerical order.
ANSIC       = "Mon Jan _2 15:04:05 2006"
UnixDate    = "Mon Jan _2 15:04:05 MST 2006"
RubyDate    = "Mon Jan 02 15:04:05 -0700 2006"
RFC822      = "02 Jan 06 15:04 MST"
RFC822Z     = "02 Jan 06 15:04 -0700" // RFC822 with numeric zone
RFC850      = "Monday, 02-Jan-06 15:04:05 MST"
RFC1123     = "Mon, 02 Jan 2006 15:04:05 MST"
RFC1123Z    = "Mon, 02 Jan 2006 15:04:05 -0700" // RFC1123 with numeric zone
RFC3339     = "2006-01-02T15:04:05Z07:00"
RFC3339Nano = "2006-01-02T15:04:05.999999999Z07:00"
Kitchen     = "3:04PM"
// Handy time stamps.
Stamp      = "Jan _2 15:04:05"
StampMilli = "Jan _2 15:04:05.000"
StampMicro = "Jan _2 15:04:05.000000"
StampNano  = "Jan _2 15:04:05.000000000"
DateTime   = "2006-01-02 15:04:05"
DateOnly   = "2006-01-02"
TimeOnly   = "15:04:05"

This proposal is for adding new constants as below;

// dotted
"2006.01.02 15:04:05" // new layout
"2006.01.02 15:04" // new layout
"2006.01.02" // new layout

// hyphened
"2006-01-02 15:04:05" // already exist
"2006-01-02 15:04" // new layout
"2006-01-02" // already exist
@nemre nemre added the Proposal label Mar 17, 2023
@gopherbot gopherbot added this to the Proposal milestone Mar 17, 2023
@bcmills
Copy link
Contributor

bcmills commented Mar 17, 2023

What would the names for these layouts be?

What RFCs specify them, or what notable uses of them exist that would justify putting them in the standard time package?

@bcmills bcmills added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Mar 17, 2023
@dsnet
Copy link
Member

dsnet commented Mar 19, 2023

See #52746, there doesn't seem to be any wide usage of dot-separated time fields among the top 31 formats used in open-source.

@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@golang golang locked and limited conversation to collaborators Apr 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge Proposal WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants