mirror of
https://github.com/golang/go
synced 2024-11-18 00:54:45 -07:00
time: mention receiver in Unix, UnixNano docs
Fixes #3248. R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/5784052
This commit is contained in:
parent
2b64e00f16
commit
2ee538bc27
@ -756,13 +756,13 @@ func (t Time) Zone() (name string, offset int) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unix returns the Unix time, the number of seconds elapsed
|
// Unix returns t as a Unix time, the number of seconds elapsed
|
||||||
// since January 1, 1970 UTC.
|
// since January 1, 1970 UTC.
|
||||||
func (t Time) Unix() int64 {
|
func (t Time) Unix() int64 {
|
||||||
return t.sec + internalToUnix
|
return t.sec + internalToUnix
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnixNano returns the Unix time, the number of nanoseconds elapsed
|
// UnixNano returns t as a Unix time, the number of nanoseconds elapsed
|
||||||
// since January 1, 1970 UTC.
|
// since January 1, 1970 UTC.
|
||||||
func (t Time) UnixNano() int64 {
|
func (t Time) UnixNano() int64 {
|
||||||
return (t.sec+internalToUnix)*1e9 + int64(t.nsec)
|
return (t.sec+internalToUnix)*1e9 + int64(t.nsec)
|
||||||
|
Loading…
Reference in New Issue
Block a user