coredatetime

package
v0.0.0-...-48fa796 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModuleName is the prefix given to all the functions in this module.
	ModuleName = "datetime"
)

Variables

This section is empty.

Functions

func Format

func Format(input []types.Value) (types.Value, error)

Format returns returns a textual representation of the input time. The format has to be defined like specified by the golang "time" package. The time is the number of seconds since the epoch, and matches what comes from our Now function. Golang documentation: https://golang.ir/pkg/time/#Time.Format

func Hour

func Hour(input []types.Value) (types.Value, error)

Hour returns the hour of the day corresponding to the input time. The time is the number of seconds since the epoch, and matches what comes from our Now function.

func Weekday

func Weekday(input []types.Value) (types.Value, error)

Weekday returns the lowercased day of the week corresponding to the input time. The time is the number of seconds since the epoch, and matches what comes from our Now function.

Types

type DateTimeFact

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

DateTimeFact is a fact which returns the current date and time.

func (*DateTimeFact) Close

func (obj *DateTimeFact) Close() error

Close runs some shutdown code for this fact and turns off the stream.

func (*DateTimeFact) Info

func (obj *DateTimeFact) Info() *facts.Info

Info returns some static info about itself.

func (*DateTimeFact) Init

func (obj *DateTimeFact) Init(init *facts.Init) error

Init runs some startup code for this fact.

func (*DateTimeFact) Stream

func (obj *DateTimeFact) Stream() error

Stream returns the changing values that this fact has over time.

Jump to

Keyboard shortcuts

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