Time.AppendFormat in Go

Posted by GoDoc
Public (Editable by Users)

AppendFormat is like Format but appends the textual representation to b and returns the extended buffer.

Go
Edit
package main

import (
	"fmt"
	"time"
)

func main() {
	t := time.Date(2017, time.November, 4, 11, 0, 0, 0, time.UTC)
	text := []byte("Time: ")

	text = t.AppendFormat(text, time.Kitchen)
	fmt.Println(string(text))
}