github.com/patricebensoussan/go/codec@v1.2.99/goversion_fmt_time_lt_go15.go (about)

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