⌛️The missing strftime in Go
Go
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.travis.yml Update travis go version Apr 24, 2018
README.md Add travis badge Apr 24, 2018
time.go Initial commit Apr 24, 2018
time_test.go Initial commit Apr 24, 2018

README.md

⌛️cstrftime GoDoc codecov Build Status

The missing strftime in Go.

Installation

> go get github.com/cooldrip/cstrftime

Example

package main

import "github.com/cooldrip/cstrftime"

func main() {
	t := time.Now()
	fmt.Println(cstrftime.Format("%d", t)) // 25
	fmt.Println(cstrftime.Format("%M", t)) // 54
	// etc.
}

Directives

Date

Directive Example
%a Sun
%A Sunday
%w 0..6 (Sunday is 0)
%y 13
%Y 2013
%b Jan
%B January
%m 01..12
%d 01..31
%e 1..31

Time

Directive Example
%l 1
%H 00..23
%I 01..12
%M 00..59
%S 00..60
%p AM
%Z +08
%j 001..366
%% %