Documentation
¶
Index ¶
- Constants
- func DayStartTime(t time.Time) time.Time
- func EmptyTimeToNow(t time.Time) time.Time
- func FormatAsDate(t time.Time) string
- func FormatYDMHMS(in time.Time) string
- func LastDay(d time.Time) time.Time
- func NextDay(d time.Time) time.Time
- func NowStrYMDHMS() string
- func SplitStr2DateRange(utime, separator string) (start string, end string, err error)
- func Time2Pointer(input time.Time) *time.Time
- func TimeFormat(tm time.Time, format string) (res string)
- func TimeFormatByYMDHMS(format string) (res string)
- func Timestamp2TimeInt64(in int64) time.Time
- func Timestamp2TimeUint64(in uint64) time.Time
- func TodayStartTime() time.Time
- func TomorrowStartTime() time.Time
- func YesterdayStartTime() time.Time
- type DateTimeRange
- type JsonTime
- type SortableTimeArray
Constants ¶
View Source
const ( TimeFormatYMDhms = "2006-01-02 15:04:05" //default format TimeFormatYMD = "2006-01-02" //default format )
Variables ¶
This section is empty.
Functions ¶
func FormatAsDate ¶ added in v0.6.2
func FormatYDMHMS ¶ added in v0.7.0
func NowStrYMDHMS ¶ added in v0.7.0
func NowStrYMDHMS() string
func SplitStr2DateRange ¶ added in v0.8.1
func Time2Pointer ¶ added in v0.6.6
time.Time to *time.Time https://github.com/golang/go/issues/45653#issuecomment-823821601
func TimeFormatByYMDHMS ¶
func Timestamp2TimeInt64 ¶
func Timestamp2TimeUint64 ¶
func TodayStartTime ¶ added in v0.6.7
func TomorrowStartTime ¶ added in v0.7.0
func YesterdayStartTime ¶ added in v0.7.0
Types ¶
type DateTimeRange ¶ added in v0.8.1
type DateTimeRange struct { Start time.Time End time.Time TimestampStart uint64 TimestampEnd uint64 DateTimeString string DateString string }
func DayRange ¶ added in v0.7.0
func DayRange(d time.Time) (dateSE DateTimeRange)
func GetTodayRange ¶
func GetTodayRange() DateTimeRange
func GetYesterdayRange ¶
func GetYesterdayRange() DateTimeRange
func LastDayRange ¶ added in v0.7.0
func LastDayRange(d time.Time) DateTimeRange
func NextDayRange ¶ added in v0.7.0
func NextDayRange(d time.Time) DateTimeRange
type JsonTime ¶ added in v0.8.1
func (JsonTime) GetFormatStr ¶ added in v0.8.1
func (JsonTime) MarshalJson ¶ added in v0.8.1
func (*JsonTime) UnmarshalJson ¶ added in v0.8.1
type SortableTimeArray ¶ added in v0.8.1
Sortable time array
func (SortableTimeArray) Len ¶ added in v0.8.1
func (s SortableTimeArray) Len() int
func (SortableTimeArray) Less ¶ added in v0.8.1
func (s SortableTimeArray) Less(i, j int) bool
func (SortableTimeArray) Swap ¶ added in v0.8.1
func (s SortableTimeArray) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.