You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
270 B

11 years ago
10 years ago
11 years ago
11 years ago
  1. package binary
  2. import (
  3. "io"
  4. "time"
  5. )
  6. // Time
  7. func WriteTime(t time.Time, w io.Writer, n *int64, err *error) {
  8. WriteInt64(t.UnixNano(), w, n, err)
  9. }
  10. func ReadTime(r io.Reader, n *int64, err *error) time.Time {
  11. t := ReadInt64(r, n, err)
  12. return time.Unix(0, t)
  13. }