Пример #1
0
// usec converts a time in microseconds since the Unix epoch to a string
// suitable for display to a user, in UTC.
func usec(usec int64) string {
	t := time.NanosecondsToUTC(usec * 1000)
	return t.Format("2006-01-02 15:04:05.000 MST")
}
Пример #2
0
func (p *Packet) String() string {
	theTime := time.NanosecondsToUTC(p.Time * 1e6)
	return fmt.Sprintf("Packet{Payload: %s, Slot: %d, Time: %s}\n",
		p.Payload, p.Slot, theTime.Format(time.StampNano))
}