htime

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func Now

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 ToTimeInDefaultLocationE added in v0.0.5

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

Types

type AsTimeProvider

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

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

type TimeFormatter added in v0.0.5

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

TimeFormatter is locale aware.

func NewTimeFormatter added in v0.0.5

func NewTimeFormatter(ltr locales.Translator) TimeFormatter

func (TimeFormatter) Format added in v0.0.5

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