Skip to content

time: add the ability to parse yearDay #25689

@bantl23

Description

@bantl23

Consider adding in the ability to parse yearDay in time.parse.

Currently there is no way to parse a time with a yearDay value. Consider adding the ability to into the time.parse function.

YYYY = 4 digit year
MM = 2 digit month
DD = 2 digit day
HH = 2 digit hour
MM = 2 digit minute
SS = 2 digit second
DOY = 3 digit yearday

2006-01-02 15:04:05 which can parse YYYY-MM-DD HH:MM:SS

Consider adding in something like this

2006-888 15:04:05 which would be able to parse YYYY-DOY HH:MM:SS

What version of Go are you using (go version)?

go version go1.10.2 linux/amd64

Does this issue reproduce with the latest release?

Feature Request

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/vagrant/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/vagrant/go"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build508236003=/tmp/go-build -gno-record-gcc-switches"

What did you do?

N/A

What did you expect to see?

N/A

What did you see instead?

N/A

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions