File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 1
1
# go-strftime
2
2
3
+ [ ![ GoDoc] ( https://godoc.org/github.com/imperfectgo/go-strftime?status.svg )] ( https://godoc.org/github.com/imperfectgo/go-strftime )
4
+ [ ![ Build Status] ( https://travis-ci.org/imperfectgo/go-strftime.svg?branch=master )] ( https://travis-ci.org/imperfectgo/go-strftime )
5
+ [ ![ Go Report Card] ( https://goreportcard.com/badge/github.com/imperfectgo/go-strftime )] ( https://goreportcard.com/report/github.com/imperfectgo/go-strftime )
6
+ [ ![ Coverage] ( https://codecov.io/gh/imperfectgo/go-strftime/branch/master/graph/badge.svg )] ( https://codecov.io/gh/imperfectgo/go-strftime )
7
+
3
8
High performance C99-compatible ` strftime ` formatter for Go.
4
9
5
10
** EXPERIMENTAL** Please DO NOT USE for now.
Original file line number Diff line number Diff line change @@ -49,6 +49,8 @@ const (
49
49
stdMask = 1 << stdArgShift - 1 // mask out argument
50
50
)
51
51
52
+ // Format returns a textual representation of the time value formatted
53
+ // according to C99-compatible strftime layout.
52
54
func Format (t time.Time , layout string ) string {
53
55
const bufSize = 64
54
56
var b [bufSize ]byte
@@ -57,6 +59,8 @@ func Format(t time.Time, layout string) string {
57
59
return string (buf )
58
60
}
59
61
62
+ // AppendFormat is like Format but appends the textual
63
+ // representation to b and returns the extended buffer.
60
64
func AppendFormat (b []byte , t time.Time , layout string ) []byte {
61
65
var (
62
66
name , offset , abs = locabs (& t )
You can’t perform that action at this time.
0 commit comments