carbon

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: BSD-3-Clause Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultDateTimeFormat = "2006-01-02 15:04:05"
	DefaultDateFormat     = "2006-01-02"
	WeekStartDay          = time.Monday
	Timezone              = time.Local
)

Functions

func AddParseLoyouts added in v0.1.3

func AddParseLoyouts(layouts ...string)

func FormatNow

func FormatNow(format string) string

func GetMillisecond

func GetMillisecond() int64

func GetTimestamp

func GetTimestamp() int64

Types

type Carbon

type Carbon struct {
	Valid bool
	// contains filtered or unexported fields
}

func New

func New(t time.Time, tz ...*time.Location) Carbon

func Now

func Now(tz ...*time.Location) Carbon

func Parse

func Parse(value string, tz *time.Location, layout ...string) (Carbon, error)

func Today

func Today() Carbon

func Tomorrow

func Tomorrow() Carbon

func (Carbon) Add

func (c Carbon) Add(sec time.Duration) Carbon

//////////////////////// Others ///////////////////////

func (Carbon) AddDay

func (c Carbon) AddDay() Carbon

AddDay add one day

func (Carbon) AddDays

func (c Carbon) AddDays(days int) Carbon

AddDays modify day

func (Carbon) AddHour added in v0.1.3

func (c Carbon) AddHour() Carbon

func (Carbon) AddHours added in v0.1.3

func (c Carbon) AddHours(hours int) Carbon

//////////////////////// Hours ///////////////////////

func (Carbon) AddMinute

func (c Carbon) AddMinute() Carbon

func (Carbon) AddMinutes

func (c Carbon) AddMinutes(minutes int) Carbon

//////////////////////// Minute ///////////////////////

func (Carbon) AddWeek

func (c Carbon) AddWeek() Carbon

func (Carbon) AddWeeks

func (c Carbon) AddWeeks(weeks int) Carbon

func (Carbon) Clone

func (c Carbon) Clone() Carbon

func (Carbon) EndOfDay

func (c Carbon) EndOfDay() Carbon

EndOfDay

func (Carbon) EndOfHour added in v0.1.3

func (c Carbon) EndOfHour() Carbon

func (Carbon) EndOfMinute

func (c Carbon) EndOfMinute() Carbon

func (Carbon) EndOfWeek

func (c Carbon) EndOfWeek() Carbon

func (Carbon) Format

func (c Carbon) Format(format ...string) string

func (Carbon) GetDateString

func (c Carbon) GetDateString() string

func (Carbon) GetDateTimeString

func (c Carbon) GetDateTimeString() string

func (Carbon) GetTime

func (c Carbon) GetTime() time.Time

func (Carbon) GetTimestamp

func (c Carbon) GetTimestamp() int64

func (Carbon) MarshalJSON

func (c Carbon) MarshalJSON() ([]byte, error)

func (*Carbon) Scan

func (c *Carbon) Scan(src interface{}) (e error)

func (*Carbon) ScanInput added in v0.1.5

func (c *Carbon) ScanInput(data []byte) error

func (Carbon) StartOfDay

func (c Carbon) StartOfDay() Carbon

StartOfDay

func (Carbon) StartOfHour added in v0.1.3

func (c Carbon) StartOfHour() Carbon

func (Carbon) StartOfMinute

func (c Carbon) StartOfMinute() Carbon

func (Carbon) StartOfWeek

func (c Carbon) StartOfWeek() Carbon

func (Carbon) String

func (c Carbon) String() string

func (Carbon) Value

func (c Carbon) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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