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

time: support parsing and formatting timestamps that don't use period for fractional seconds #26002

Open
theckman opened this Issue Jun 21, 2018 · 1 comment

Comments

Projects
None yet
3 participants
@theckman
Copy link
Contributor

theckman commented Jun 21, 2018

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

go version go1.10.1 darwin/amd64

Does this issue reproduce with the latest release?

Yes

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

GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/theckman/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/theckman/go/"
GORACE=""
GOROOT="/Users/theckman/.gimme/versions/go1.10.1.darwin.amd64"
GOTMPDIR=""
GOTOOLDIR="/Users/theckman/.gimme/versions/go1.10.1.darwin.amd64/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/f5/zjcsdkrx2bxdm32zzqfg5yp80000gn/T/go-build809411951=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

https://play.golang.org/p/TEo-WL4gGsq

What did you expect to see?

I expected to be able to use either 2006-01-02 15:04:05,999 or 2006-01-02 15:04:05,000 to parse a timestamp like 2018-06-15 18:12:22,013. Especially as some written languages / countries use , to indicate fractions instead of ..

What did you see instead?

An error indicating that 013 could not be parsed in to ,999.

@lrewega

This comment has been minimized.

Copy link

lrewega commented Jun 21, 2018

Looks similar to #6189

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment