htime

package
v0.124.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 6 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Clock = clocks.System()
)

Functions

func Now added in v0.99.0

func Now() time.Time

Now returns time.Now() or time value based on the `clock` flag. Use this function to fake time inside hugo.

func Since added in v0.99.0

func Since(t time.Time) time.Duration

func StopWatch added in v0.112.0

func StopWatch(name string) func()

StopWatch is a simple helper to measure time during development.

func ToTimeInDefaultLocationE

func ToTimeInDefaultLocationE(i any, location *time.Location) (tim time.Time, err error)

Types

type AsTimeProvider added in v0.100.2

type AsTimeProvider interface {
	AsTime(zone *time.Location) time.Time
}

AsTimeProvider is implemented by go-toml's LocalDate and LocalDateTime.

type TimeFormatter

type TimeFormatter struct {
	// contains filtered or unexported fields
}

TimeFormatter is locale aware.

func NewTimeFormatter

func NewTimeFormatter(ltr locales.Translator) TimeFormatter

func (TimeFormatter) Format

func (f TimeFormatter) Format(t time.Time, layout string) string

Jump to

Keyboard shortcuts

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