Documentation ¶
Index ¶
- Constants
- func ConvertTimeToGMT07(t time.Time) time.Time
- func ConvertToUnixTime(t time.Time) int64
- func ConvertUnixTimeRFC3339String(timeStamp int64) string
- func GMT07Location() *time.Location
- func GetBeginTimeOfDay(timestamp int64) int64
- func GetDayOfWeekNameNormalLetter(dayOfWeek time.Weekday) string
- func GetDayOfWeekNameShort(dayOfWeek time.Weekday) string
- func GetDayOfWeekNameUpperFirstLetter(dayOfWeek time.Weekday) string
- func GetDaysBetweenDates(first, second time.Time) int64
- func Init()
- func IsEqualDate(t1, t2 time.Time) bool
- func IsOnTheSameDate(t1, t2 time.Time) bool
- func NowInGMT07String(format string) string
- func NowInGMT07StringRFC3339() string
- func ParseOpenTimeText(opensAt int64, closesAt int64) string
- func ParseStringDateToFormatDate(timeString string, format string) string
- func ParseStringToTime(timeString string) time.Time
- func ParseStringToUnixTimestampLocation(timeStr string) int64
- func ParseTimestampToFormatDate(timeStamp int64, format string) string
- func TimeBeginDayByTime(t time.Time) time.Time
- func TimeEndDayByTime(t time.Time) time.Time
- func TimeInGMT07String(t time.Time, format string) string
- func TimeInGMT07StringRFC3339(t time.Time) string
- func TimestampToGMT07Time(timestamp int64) time.Time
- func TimestampToTimeUTC(timestamp int64) time.Time
- type Date
- type DateTime
- type NowFn
- type NowTimestampFn
Constants ¶
View Source
const ( FormatYMD = "yyyy-MM-dd" // YYYY_MM_DD_HH_MM_SS_SSS is the format "2006-01-02 15:04:05.000". YYYY_MM_DD_HH_MM_SS_SSS = "2006-01-02 15:04:05.000" // YYYY_MM_DD_HH_MM_SS is the format "2006-01-02 15:04:05". YYYY_MM_DD_HH_MM_SS = "2006-01-02 15:04:05" // YYYY_MM_DD is the format "2006-01-02". YYYY_MM_DD = "2006-01-02" // DD_MM_YYYY is the format "02-01-2006". DD_MM_YYYY = "02-01-2006" // DD_MM_YYYY_HH_MM_SS is the format "02-01-2006 15:04:05". DD_MM_YYYY_HH_MM_SS = "02-01-2006 15:04:05" // DD_MM_YYYY_HH_MM_SS_SSS is the format "02-01-2006 15:04:05.000". DD_MM_YYYY_HH_MM_SS_SSS = "02-01-2006 15:04:05.000" DMFormat = "d/m" )
Variables ¶
This section is empty.
Functions ¶
func ConvertToUnixTime ¶
func ConvertUnixTimeRFC3339String ¶
* Convert timestamp to string with custom RFC3339 format without GMT ex: 2006-01-02T15:04:05Z07:00
func GMT07Location ¶
func GetBeginTimeOfDay ¶
func GetDayOfWeekNameNormalLetter ¶
GetDayOfWeekName get name of day of week, sunday is 0, 1 to 6 is from monday to saturday
func GetDayOfWeekNameShort ¶
func GetDayOfWeekNameUpperFirstLetter ¶
GetDayOfWeekName get name of day of week, sunday is 0, 1 to 6 is from monday to saturday
func GetDaysBetweenDates ¶
func IsEqualDate ¶
func IsOnTheSameDate ¶
func NowInGMT07String ¶
func NowInGMT07StringRFC3339 ¶
func NowInGMT07StringRFC3339() string
func ParseOpenTimeText ¶
func ParseStringToTime ¶
ParseStringToTime convert string to time object
func ParseStringToUnixTimestampLocation ¶
* Convert timestamp to string with custom RFC3339 format without GMT07 ex: 2006-01-02T15:04:05Z07:00
func TimeBeginDayByTime ¶
TimeBeginDayByTime convert time to time begin of day
func TimeEndDayByTime ¶
TimeEndDayByTime convert time to time end of day
func TimestampToGMT07Time ¶
func TimestampToTimeUTC ¶
Types ¶
type NowTimestampFn ¶
type NowTimestampFn func() int64
Click to show internal directories.
Click to hide internal directories.