...

Package xtime

import "simonwaldherr.de/go/golibs/xtime"
Overview
Index
Examples

Overview ▾

func Fmt

func Fmt(format string, t time.Time) string

Fmt (xtime.Fmt) is an alias for StrfTime

Example

Code:

t := time.Unix(1234567890, 0)
cet, _ := time.LoadLocation("CET")
t = t.In(cet)
fmt.Println(xtime.Fmt("%Y-%m-%d %H:%M:%S", t))

Output:

2009-02-14 00:31:30

func FmtNow

func FmtNow(format string) string

FmtNow is like StrfTime, but automatically with the current local time

func StrfTime

func StrfTime(format string, t time.Time) string

StrfTime implements a subset of strftime http://man7.org/linux/man-pages/man3/strftime.3.html