sTime

package
v0.1.84 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2025 License: MIT Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DateSeparator = "."

Functions

func ForLog

func ForLog(value any, prec int) string

func ForWeb

func ForWeb(value any, prec int) string

func Format

func Format(value any, prec int) string

func FormatSep

func FormatSep(value any, prec int, separator string) string

func NewCron added in v0.1.74

func NewCron(location *time.Location) *cron

func Since

func Since(duration time.Duration) string

func TimeControl added in v0.1.9

func TimeControl(f func(), name string)

func TimeControlError added in v0.1.37

func TimeControlError(f func() error, name string) error

func ToTime

func ToTime(value any) (time.Time, error)

Types

type InterCron added in v0.1.74

type InterCron interface {
	IsActive() bool
	Active() error
	Inactive()

	SetLocation(string) error
	SetMinute(string) error
	SetHour(string) error
	SetDay(string) error
	SetMonth(string) error
	SetDayOfWeek(string) error
	SetSchedule(string) error

	Next(int64) int64
}

type InterProvider added in v0.1.69

type InterProvider interface {
	SetComma(rune)
	SetLayout(string)
	SetLayoutDate(string)
	SetLayoutTime(string)
	SetLocation(string) error
	SetTimeDiff(time.Duration)

	Comma() rune
	LayoutDate() string
	LayoutTime() string

	GetUTC(string) (int64, error)
	GetDate(int64) string
	GetTime(int64) string
	GetDateAndTime(int64) (string, string)
}

type Provider added in v0.1.69

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

func NewProvider added in v0.1.69

func NewProvider() *Provider

func (*Provider) Comma added in v0.1.69

func (p *Provider) Comma() rune

func (*Provider) GetDate added in v0.1.84

func (p *Provider) GetDate(ts int64) string

func (*Provider) GetDateAndTime added in v0.1.84

func (p *Provider) GetDateAndTime(ts int64) (string, string)

func (*Provider) GetTime added in v0.1.84

func (p *Provider) GetTime(ts int64) string

func (*Provider) GetUTC added in v0.1.69

func (p *Provider) GetUTC(str string) (int64, error)

func (*Provider) LayoutDate added in v0.1.69

func (p *Provider) LayoutDate() string

func (*Provider) LayoutTime added in v0.1.69

func (p *Provider) LayoutTime() string

func (*Provider) SetComma added in v0.1.69

func (p *Provider) SetComma(comma rune)

func (*Provider) SetLayout added in v0.1.69

func (p *Provider) SetLayout(layout string)

func (*Provider) SetLayoutDate added in v0.1.69

func (p *Provider) SetLayoutDate(layout string)

func (*Provider) SetLayoutTime added in v0.1.69

func (p *Provider) SetLayoutTime(layout string)

func (*Provider) SetLocation added in v0.1.69

func (p *Provider) SetLocation(name string) error

func (*Provider) SetTimeDiff added in v0.1.69

func (p *Provider) SetTimeDiff(diff time.Duration)