~john-koepi/ubuntu/trusty/golang/default

« back to all changes in this revision

Viewing changes to src/pkg/time/time.go

  • Committer: Package Import Robot
  • Author(s): Ondřej Surý
  • Date: 2012-05-02 15:44:59 UTC
  • mfrom: (14.1.12 sid)
  • Revision ID: package-import@ubuntu.com-20120502154459-wcmy8ao1325ml619
Tags: 2:1.0.1-1
* Imported Upstream version 1.0.1
* Apply godoc patch to display package list correctly (Closes: #669354)

Show diffs side-by-side

added added

removed removed

Lines of Context:
403
403
        Hour                 = 60 * Minute
404
404
)
405
405
 
406
 
// Duration returns a string representing the duration in the form "72h3m0.5s".
 
406
// String returns a string representing the duration in the form "72h3m0.5s".
407
407
// Leading zero units are omitted.  As a special case, durations less than one
408
408
// second format use a smaller unit (milli-, micro-, or nanoseconds) to ensure
409
409
// that the leading digit is non-zero.  The zero duration formats as 0,
763
763
}
764
764
 
765
765
// UnixNano returns t as a Unix time, the number of nanoseconds elapsed
766
 
// since January 1, 1970 UTC.
 
766
// since January 1, 1970 UTC. The result is undefined if the Unix time
 
767
// in nanoseconds cannot be represented by an int64. Note that this
 
768
// means the result of calling UnixNano on the zero Time is undefined.
767
769
func (t Time) UnixNano() int64 {
768
770
        return (t.sec+internalToUnix)*1e9 + int64(t.nsec)
769
771
}