]> Cypherpunks repositories - gostls13.git/commit
time: do not segment time strings by character class.
authorRuss Cox <rsc@golang.org>
Tue, 30 Mar 2010 21:54:32 +0000 (14:54 -0700)
committerRuss Cox <rsc@golang.org>
Tue, 30 Mar 2010 21:54:32 +0000 (14:54 -0700)
commit78547ca13214e6e3062fb5600afe05bd2e6d93dc
tree78982a1f4a6a5a7323a990ded033a6db0e592be4
parent8fbe8bee6c82f9c1a346eab78a1babfb2bb86d54
time: do not segment time strings by character class.
instead use pure substring matching to find template values.

this makes stdZulu unnecessary and allows formats
like "20060102 030405" (used in some internet protocols).

this makes Parse not handle years < 0000 or > 9999 anymore.
that seems like an okay price to pay, trading hypothetical
functionality for real functionality.

also changed the comments on the Time struct to use the
same reference date as the format and parse routines.

R=r
CC=golang-dev
https://golang.org/cl/833045
src/pkg/time/format.go
src/pkg/time/time.go
src/pkg/time/time_test.go