Categorygithub.com/jehiah/go-strftime
modulepackage
0.0.0-20171201141054-1d33003b3869
Repository: https://github.com/jehiah/go-strftime.git
Documentation: pkg.go.dev

# README

go-strftime

go implementation of strftime

Example

package main

import (
	"fmt"
	"time"

	strftime "github.com/jehiah/go-strftime"
)

func main() {
	t := time.Unix(1340244776, 0)
	utc, _ := time.LoadLocation("UTC")
	t = t.In(utc)
	fmt.Println(strftime.Format("%Y-%m-%d %H:%M:%S", t))
	// Output:
	// 2012-06-21 02:12:56
}

# Functions

This is an alternative to time.Format because no one knows what date 040305 is supposed to create when used as a 'layout' string this takes standard strftime format options.