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
266 B

11 years ago
11 years ago
11 years ago
11 years ago
  1. package binary
  2. import (
  3. "io"
  4. "time"
  5. )
  6. // Time
  7. func WriteTime(w io.Writer, t time.Time, n *int64, err *error) {
  8. WriteInt64(w, t.Unix(), 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(t, 0)
  13. }