lstime

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const Day = 24 * time.Hour

Variables

This section is empty.

Functions

func FormatDuration

func FormatDuration(dur time.Duration) string

example: ls-go --expr 'mtime().Sub(now())'

Types

type TimeParams

type TimeParams struct {
	FormatStr     string
	UnixFormatStr string
	MaxWidth      int
	Relative      bool
}

UnixFormatStr will be empty unless set by user with --time-style=+... so if UnixFormatStr is set, we ignore FormatStr in case of UnixFormatStr, MaxWidth is set once and used afterwards if Relative is true, we ignore all other fields

func (*TimeParams) SetTimeStyle

func (f *TimeParams) SetTimeStyle(style string) error

Jump to

Keyboard shortcuts

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