time

package
v0.0.0-...-0d8370d Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2025 License: MIT Imports: 12 Imported by: 3

Documentation

Overview

Package time GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE

Index

Constants

This section is empty.

Variables

View Source
var (
	UTC               = time.UTC
	TimestampZero     = Timestamp(time.Time{})
	TimestampUnixZero = Timestamp(time.Unix(0, 0))
)
View Source
var CST = time.UTC

Functions

func AddSupportedLayout

func AddSupportedLayout(layout string, location *time.Location)

func IsDuration

func IsDuration(str string) bool

func ParseDuration

func ParseDuration(cand string) (time.Duration, error)

func SetOutputLayout

func SetOutputLayout(layout string, location *time.Location)

func Sub

func Sub(t Timestamp, u Timestamp) time.Duration

Types

type CreationModificationTime

type CreationModificationTime struct {
	CreationTime
	// 更新时间
	UpdatedAt Timestamp `db:"f_updated_at,default='0'" json:"updatedAt"`
}

func (*CreationModificationTime) RuntimeDoc

func (v *CreationModificationTime) RuntimeDoc(names ...string) ([]string, bool)

type CreationTime

type CreationTime struct {
	// 创建时间
	CreatedAt Timestamp `db:"f_created_at,default='0'" json:"createdAt"`
}

func (*CreationTime) MarkCreatedAt

func (times *CreationTime) MarkCreatedAt()

func (*CreationTime) RuntimeDoc

func (v *CreationTime) RuntimeDoc(names ...string) ([]string, bool)

type CreationUpdationDeletionTime

type CreationUpdationDeletionTime struct {
	CreationUpdationTime
	// 删除时间
	DeletedAt Timestamp `db:"f_deleted_at,default='0'" json:"deletedAt,omitempty"`
}

func (*CreationUpdationDeletionTime) MarkDeletedAt

func (times *CreationUpdationDeletionTime) MarkDeletedAt()

func (*CreationUpdationDeletionTime) RuntimeDoc

func (v *CreationUpdationDeletionTime) RuntimeDoc(names ...string) ([]string, bool)

func (CreationUpdationDeletionTime) SoftDeleteFieldAndZeroValue

func (CreationUpdationDeletionTime) SoftDeleteFieldAndZeroValue() (string, driver.Value)

type CreationUpdationTime

type CreationUpdationTime = CreationModificationTime

func (*CreationUpdationTime) MarkCreatedAt

func (times *CreationUpdationTime) MarkCreatedAt()

func (*CreationUpdationTime) MarkModifiedAt

func (times *CreationUpdationTime) MarkModifiedAt()

type Duration

type Duration time.Duration

func (Duration) IsZero

func (d Duration) IsZero() bool

func (Duration) MarshalText

func (d Duration) MarshalText() ([]byte, error)

func (Duration) OpenAPISchemaFormat

func (Duration) OpenAPISchemaFormat() string

func (*Duration) Scan

func (d *Duration) Scan(raw interface{}) error

func (Duration) String

func (d Duration) String() string

func (*Duration) UnmarshalText

func (d *Duration) UnmarshalText(data []byte) error

type Timestamp

type Timestamp time.Time

func Add

func Add(t Timestamp, d time.Duration) Timestamp

func AddDate

func AddDate(t Timestamp, years int, months int, days int) Timestamp

func Now

func Now() Timestamp

func ParseTimestampFromString

func ParseTimestampFromString(s string) (d Timestamp, err error)

func ParseTimestampFromStringWithLayout

func ParseTimestampFromStringWithLayout(input, layout string) (Timestamp, error)

func (Timestamp) DataType

func (Timestamp) DataType(engine string) string

func (Timestamp) Date

func (dt Timestamp) Date() (int, time.Month, int)

func (Timestamp) Day

func (dt Timestamp) Day() int

func (Timestamp) Format

func (dt Timestamp) Format(layout string) string

func (Timestamp) In

func (dt Timestamp) In(loc *time.Location) Timestamp

func (Timestamp) IsZero

func (dt Timestamp) IsZero() bool

func (Timestamp) MarshalText

func (dt Timestamp) MarshalText() ([]byte, error)

func (Timestamp) Month

func (dt Timestamp) Month() time.Month

func (Timestamp) OpenAPISchemaFormat

func (Timestamp) OpenAPISchemaFormat() string

func (*Timestamp) Scan

func (dt *Timestamp) Scan(value interface{}) error

func (Timestamp) String

func (dt Timestamp) String() string

func (Timestamp) Unix

func (dt Timestamp) Unix() int64

func (*Timestamp) UnmarshalText

func (dt *Timestamp) UnmarshalText(data []byte) (err error)

func (Timestamp) Value

func (dt Timestamp) Value() (driver.Value, error)

func (Timestamp) Year

func (dt Timestamp) Year() int

Jump to

Keyboard shortcuts

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