time

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LayoutUnix   = "unix"
	LayoutUnixMs = "unix_ms"
)

Variables

This section is empty.

Functions

func Format

func Format(timestamp time.Time, location string, layout string) (interface{}, error)

func TimeFormatNow

func TimeFormatNow(pattern string) string

func TranslateTimestampSince added in v1.4.0

func TranslateTimestampSince(timestamp metav1.Time) string

func UnixMilli

func UnixMilli(t time.Time) int64

Types

type Duration

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

func (*Duration) Duration

func (d *Duration) Duration() time.Duration

Duration return time.duration struct

func (Duration) MarshalYAML

func (d Duration) MarshalYAML() (interface{}, error)

MarshalYAML implements the yaml.Marshaler interface.

func (*Duration) String

func (d *Duration) String() string

func (*Duration) UnmarshalYAML

func (d *Duration) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

Jump to

Keyboard shortcuts

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