http://codereview.appspot.com/179079/diff/1005/1006#newcode323
src/pkg/time/time.go:323: decimal(buf[bp:bp+2], t.Month);
delete all the trailing semicolons
http://codereview.appspot.com/179079/diff/1005/1006#newcode386
src/pkg/time/time.go:386: // date(1) - Sun Nov 6 08:49:37 UTC 1994
s/ -/:/ for consistency while you're here
cd $GOROOT/src
hg sync
all.bash
hg gofmt
That explains it. I think I ran hg gofmt after the initial upload. I
have re uploaded with those changes now.
-rob
http://codereview.appspot.com/179079/diff/9/1012#newcode363
src/pkg/time/time.go:363: func (t *Time) ISO8601() (formatted string) {
s/(formatted string)/string/ - matches the others
and the name doesn't really matter here.
http://codereview.appspot.com/179079/diff/9/1012#newcode365
src/pkg/time/time.go:365: formatted = format(t, "%Y-%m-%dT%H:%M:%SZ")
return format(...)
http://codereview.appspot.com/179079/diff/9/1012#newcode370
src/pkg/time/time.go:370: if t.ZoneOffset < 0 {
in strftime this would be %z. let's move it into
format as case 'z' above. it's sure to come up again.
http://codereview.appspot.com/179079/diff/9/1012#newcode372
src/pkg/time/time.go:372: decimal(buf[bp:bp+2],
int(-1*t.ZoneOffset/3600))
s/-1*/-/
http://codereview.appspot.com/179079/diff/9/1012#newcode373
src/pkg/time/time.go:373: decimal(buf[bp+2:bp+4],
int(-1*t.ZoneOffset)%3600)
s/-1*/-/
http://codereview.appspot.com/179079/diff/13/14#newcode339
src/pkg/time/time.go:339: decimal(buf[bp:bp+2], int(-t.ZoneOffset/3600))
shouldn't need the int conversion here and on the next line.
you don't have them in the else case.
http://codereview.appspot.com/179079/diff/13/14
File src/pkg/time/time.go (right):
http://codereview.appspot.com/179079/diff/13/14#newcode339
src/pkg/time/time.go:339: decimal(buf[bp:bp+2], int(-t.ZoneOffset/3600))
On 2009/12/17 01:41:13, rsc wrote:
> shouldn't need the int conversion here and on the next line.
> you don't have them in the else case.
Done.
http://codereview.appspot.com/179079/diff/19/21
File src/pkg/time/time_test.go (right):
http://codereview.appspot.com/179079/diff/19/21#newcode104
src/pkg/time/time_test.go:104: func TestISO8601Conversion(t *testing.T)
{
If there are two tests, there will be more. Make a table
(see utctests and localtests for examples, above) and
iterate over it.
Then you can easily add a third test that has a time zone
of +0420.
http://codereview.appspot.com/179079/diff/19/21#newcode104
src/pkg/time/time_test.go:104: func TestISO8601Conversion(t *testing.T)
{
On 2009/12/17 02:00:08, rsc wrote:
> If there are two tests, there will be more. Make a table
> (see utctests and localtests for examples, above) and
> iterate over it.
> Then you can easily add a third test that has a time zone
> of +0420.
Ok, will do. Should I put the table at the top of the file or right
above the Test?
above the test is fine
http://codereview.appspot.com/179079/diff/19/21#newcode104
src/pkg/time/time_test.go:104: func TestISO8601Conversion(t *testing.T)
{
On 2009/12/17 03:40:48, benolive wrote:
> On 2009/12/17 02:00:08, rsc wrote:
> > If there are two tests, there will be more. Make a table
> > (see utctests and localtests for examples, above) and
> > iterate over it.
> >
> > Then you can easily add a third test that has a time zone
> > of +0420.
> >
> Ok, will do. Should I put the table at the top of the file or right
above the
> Test?
Done.
http://codereview.appspot.com/179079/diff/19/21
File src/pkg/time/time_test.go (right):
http://codereview.appspot.com/179079/diff/19/21#newcode104
src/pkg/time/time_test.go:104: func TestISO8601Conversion(t *testing.T)
{
On 2009/12/17 02:00:08, rsc wrote:
> If there are two tests, there will be more. Make a table
> (see utctests and localtests for examples, above) and
> iterate over it.
> Then you can easily add a third test that has a time zone
> of +0420.
Please add a test with a timezone of +0420.
http://codereview.appspot.com/179079/diff/19/21#newcode104
src/pkg/time/time_test.go:104: func TestISO8601Conversion(t *testing.T)
{
On 2009/12/17 04:27:12, rsc wrote:
> On 2009/12/17 02:00:08, rsc wrote:
> > If there are two tests, there will be more. Make a table
> > (see utctests and localtests for examples, above) and
> > iterate over it.
> >
> > Then you can easily add a third test that has a time zone
> > of +0420.
> Please add a test with a timezone of +0420.
Done.
Final hurdle: you need to complete one of the license
agreements so we can use your code. See
http://golang.org/doc/contribute.html#copyright
Thanks.
Russ
--Ben
No, sorry. I got faked out by the different
codereview.appspot.com username and
searched for benolive instead of sionide21.
I see it now. Thanks.
Russ
Will submit after 180081, currently out for review.
time: add ISO 8601 time format
Fixes issue 431.
R=r, rsc
CC=golang-dev
http://codereview.appspot.com/179079
Committer: Russ Cox <r...@golang.org>