date

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2021 License: MIT Imports: 4 Imported by: 1

README

date

date for golang.

Build Status Coverage Status Go Report Card Documentation

Install

$ go get github.com/lovego/date

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Date

type Date struct {
	time.Time
}

func New

func New(year, month, day int) Date

func NewFromTime added in v0.0.4

func NewFromTime(t time.Time) Date

func Parse

func Parse(str string) (Date, error)
Example
fmt.Println(Parse("2018-04-01"))
Output:

2018-04-01 <nil>

func Today

func Today() Date

func (Date) Add

func (date Date) Add(day int) Date

func (Date) After

func (t Date) After(u Date) bool

func (Date) Before

func (t Date) Before(u Date) bool

func (Date) Equal

func (t Date) Equal(u Date) bool

func (Date) MarshalJSON

func (date Date) MarshalJSON() ([]byte, error)

func (*Date) Scan

func (date *Date) Scan(value interface{}) error

func (Date) String

func (date Date) String() string

func (Date) Sub

func (t Date) Sub(u Date) time.Duration

func (*Date) UnmarshalJSON

func (date *Date) UnmarshalJSON(b []byte) error

func (Date) Value

func (date Date) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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