day

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTimezone

func GetTimezone() (name string, offset int)

GetTimezone get the timezone of current

func TimeZones

func TimeZones() []string

TimeZones Get a list of valid time zones

func Timezone

func Timezone(name string, offset ...int)

Timezone set the default location

func TimezoneSystem

func TimezoneSystem()

TimezoneSystem using the system default zone

func TimezoneUTC

func TimezoneUTC()

TimezoneUTC using the UTC zone

Types

type Datetime

type Datetime struct {
	time.Time
}

Datetime type of day

func Make

func Make() *Datetime

Make make a new Datetime

func Now

func Now() *Datetime

Now is a alias of Make

func Of

func Of(value interface{}, formats ...string) *Datetime

Of make a new datetime with the given value

func (*Datetime) Load

func (d *Datetime) Load(value interface{}, formats ...string) *Datetime

Load load time with given format

func (*Datetime) MarshalJSON

func (d *Datetime) MarshalJSON() ([]byte, error)

MarshalJSON for json marshalJSON

func (*Datetime) Scan

func (d *Datetime) Scan(src interface{}) error

Scan for db scan

func (*Datetime) Timezone

func (d *Datetime) Timezone(name string, offset ...int) *Datetime

Timezone set the timezone of datetime

func (*Datetime) UnmarshalJSON

func (d *Datetime) UnmarshalJSON(data []byte) error

UnmarshalJSON for json marshalJSON

func (*Datetime) Value

func (d *Datetime) Value() (driver.Value, error)

Value for db driver value

Jump to

Keyboard shortcuts

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