goversion_fmt_time_lt_go15.go 312 B

123456789101112131415
  1. // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
  2. // Use of this source code is governed by a MIT license found in the LICENSE file.
  3. // +build !go1.5
  4. package codec
  5. import "time"
  6. func fmtTime(t time.Time, b []byte) []byte {
  7. s := t.Format(time.RFC3339Nano)
  8. b = b[:len(s)]
  9. copy(b, s)
  10. return b
  11. }