Gotimetime.Format

layout形式で時刻を文字列に変換します。

문법

t.Format(layout string) string

예제

아래 값을 입력하면 예제에 즉시 반영됩니다.

fmt
Println
Go
Mon
Jan
MST
now := time.Now()
fmt.Println(now.Format("2006-01-02 15:04:05"))
// Go의 기준시: 2006-01-02 15:04:05 (Mon Jan 2 15:04:05 MST 2006)