xtime

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fmt

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

Fmt (xtime.Fmt) is an alias for StrfTime

Example
package main

import (
	"fmt"
	"simonwaldherr.de/go/golibs/xtime"
	"time"
)

func main() {
	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

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL