utils

package
v0.0.0-...-3bb77e7 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurTime

func CurTime() string

CurTime current time

func DateAdd

func DateAdd(t time.Time, amt int) time.Time

DateAdd date add DateAdd(Now(), 3)

func DateAddDuration

func DateAddDuration(t time.Time, d time.Duration) time.Time

DateAddDuration date add duration DateAddDuration(Now(), time.Duration)

func DateAndTimeAsDateTimeFormat

func DateAndTimeAsDateTimeFormat(d time.Time, t string) time.Time

DateAndTimeAsDateTimeFormat date and time as date time format

func DateDiff

func DateDiff(s, e time.Time) time.Duration

DateDiff date diff

func DateDiffFormat

func DateDiffFormat(a, b time.Time) (year, month, day, hour, min, sec int)

DateDiffFormat date diff format

func DateFormat

func DateFormat(t time.Time) string

DateFormat date format

func DateSub

func DateSub(t time.Time, amt int) time.Time

DateSub date sub DateSub(Now(), 3)

func DateTimeFormat

func DateTimeFormat(t time.Time) string

DateTimeFormat date time format

func Marshal

func Marshal(val interface{}) ([]byte, error)

Marshal marshal

func Now

func Now() time.Time

Now now

func Pointer

func Pointer[Value any](v Value) *Value

Pointer pointer

func TimeFormat

func TimeFormat(t time.Time) string

TimeFormat time format

func TimeParse

func TimeParse(layout, value string) time.Time

TimeParse time parse

func TimeParseDuration

func TimeParseDuration(t string) time.Duration

TimeParseDuration time parse duration ตย. t = "1m15s"

func TimeTtl

func TimeTtl(t string) int64

TimeTtl time ttl แปลงเป็น Milliseconds

func TimeZone

func TimeZone() string

TimeZone time zone

func Unmarshal

func Unmarshal(buf []byte, val interface{}) error

Unmarshal unmarshal

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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