timeutil

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatDuration

func FormatDuration(duration time.Duration, long bool, precision int, suffix string) string

FormatDuration formats a duration as a relative time.

Precision is the number of units to include. For example, for 65 seconds a precision of 1 would return "1 min" and a precision of 2 would return "1 min 5 secs".

func Init

func Init(config *Config)

func ToLocal

func ToLocal(t time.Time) time.Time

ToLocal converts a time to the local timezone.

Types

type Config

type Config struct {
	Timezone func() string
}

Jump to

Keyboard shortcuts

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