mo_time

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorInvalidTimeFormat = errors.New("invalid time format")
)

Functions

This section is empty.

Types

type Time

type Time interface {
	// Returns Time in ISO8601 (yyyy-MM-ddThh:mm:ssZ) format as UTC.
	// Returns an empty string if an impl. has TimeOptional, and the instance marked as unset.
	Iso8601() string

	// Same as Iso8601
	Value() string

	// Returns time instance
	Time() time.Time

	// True when the time is zero
	IsZero() bool
}

func New

func New(t time.Time) Time

func Zero

func Zero() (tm Time)

type TimeImpl

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

func (*TimeImpl) IsZero

func (z *TimeImpl) IsZero() bool

func (*TimeImpl) Iso8601

func (z *TimeImpl) Iso8601() string

func (*TimeImpl) Ok

func (z *TimeImpl) Ok() bool

func (*TimeImpl) Time

func (z *TimeImpl) Time() time.Time

func (*TimeImpl) Unset

func (z *TimeImpl) Unset()

func (*TimeImpl) UpdateTime

func (z *TimeImpl) UpdateTime(dateTime string) error

func (*TimeImpl) Value

func (z *TimeImpl) Value() string

type TimeOptional

type TimeOptional interface {
	Time
	mo_essential.Optional
}

func NewOptional

func NewOptional(t time.Time) TimeOptional

Jump to

Keyboard shortcuts

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