Skip to content

Error in time.SecondsToUTC() #363

@gopherbot

Description

@gopherbot

by hurtonm:

What steps will reproduce the problem?

package main

import (
        "time";
        "fmt";
)

func main() {
        t := time.SecondsToUTC(int64(-11644473600));
        fmt.Println(t);
}

What is the expected output? What do you see instead?

There is a mismatch between the output as produced by the Unix date(1)
utility and the above program.

date -u --date='@-11644473600' produces
Mon Jan  1 00:00:00 UTC 1601

./6.out produces
Mon Jan  2 00:00:00 UTC 1601

What is your $GOOS?  $GOARCH?
GOARCH=amd64
GOOS=linux

Which revision are you using?  (hg identify)

382a7bb58c03 tip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions