package htime
import "github.com/gohugoio/hugo/common/htime"
Index ¶
- Variables
- func Now() time.Time
- func Since(t time.Time) time.Duration
- func StopWatch(name string) func()
- func ToTimeInDefaultLocationE(i any, location *time.Location) (tim time.Time, err error)
- type AsTimeProvider
- type TimeFormatter
Variables ¶
Functions ¶
func Now ¶
Now returns time.Now() or time value based on the `clock` flag. Use this function to fake time inside hugo.
func Since ¶
func StopWatch ¶
func StopWatch(name string) func()
StopWatch is a simple helper to measure time during development.
func ToTimeInDefaultLocationE ¶
Types ¶
type AsTimeProvider ¶
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
Source Files ¶
- Version
- v0.144.2 (latest)
- Published
- Feb 19, 2025
- Platform
- linux/amd64
- Imports
- 6 packages
- Last checked
- 13 hours ago –
Tools for package owners.