Documentation ¶
Index ¶
- Constants
- func CalcEndOfMonth(date time.Time) time.Time
- func ConvertDdMmYyyyBy(date string, layout string) string
- func Date() (int, time.Month, int)
- func EndOfMonth(date time.Time) int
- func Format(year int, m time.Month, d int) string
- func FromTimestamp(timestamp int64, tz *time.Location) time.Time
- func FromTimestampGMT7(timestamp int64) time.Time
- func GetFebruaryLastOfMonth()
- func GetTimeZone(zone string) *time.Location
- func GetWeekday(date time.Time) string
- func IsIntervalElapsed(location string, timestamp time.Time, updatedAt time.Time, interval int64) (time.Time, bool)
- func IsWorkday(date time.Time) bool
- func IsWorkdayBy(date string, layout string) (bool, error)
- func IsYyyyMm(month string, format string) bool
- func MonthsToDays(months int) int
- func NextDay(day int) time.Time
- func Now() time.Time
- func NowWithoutTime() time.Time
- func Parse(date string) (time.Time, error)
- func ParseBy(date string, layout string) (time.Time, error)
- func ParseByGMT7(date string, layout string, utc ...bool) (time.Time, error)
- func ParseByLocation(date string, layout string, tz string, utc ...bool) (time.Time, error)
- func ParseByYmDash(ym string) (time.Time, error)
- func ParseByYyyyMm(month string, format string) time.Time
- func ParseDdMmYyyy(date string) (string, error)
- func ParseEndOfDay(date string) (time.Time, error)
- func ParseStartOfDay(date string) (time.Time, error)
- func PrevDay(num int) time.Time
- func PrevMonth(num int) time.Time
- func PrevYear(num int) time.Time
- func SubDay(currentDate time.Time, day int) time.Time
- func SubMonth(t time.Time, num int) time.Time
- func TimeNow() *now.Now
- func TimeNowFormat(zone string, format string) string
- func UtcToGmt7(utcTime time.Time) time.Time
- func Validate(date string, layout string) bool
- func ValidateDateFormatDash(dateTime string) bool
- func ValidateDateFormatSlash3(dateTime string) bool
Constants ¶
View Source
const ( Day = "day" Week = "week" Month = "month" Year = "year" Custom = "custom" PeriodPrevious = "previous" PeriodCurrent = "current" TimeZoneAsiaBangkok = "Asia/Bangkok" TimeFormatDash1 = "2006-01-02 15:04:05" TimeFormatSlash = "2006/01/02 15:04:05" TimeFormatDash2 = "2006-01-02 15:04" DateFormatSlash1 = "2006/01/02" DateFormatSlash2 = "02/01/2006" DateFormatSlash3 = "2/1/2006" DateFormatSlash4 = "01/02/2006 15:04:05" DateFormatDash = "2006-01-02" DateFormat = "20060102" DateFormatTime = "15:04:05" DateFormatMin = "15:04" DateFormatTime2 = "200601021504" DateTimeFormatISO = "2006-01-02T15:04:05.000Z" DateTimeFormatUTC = "2006-01-02 15:04:05 +0000 UTC" DateTimeFormatUTC2 = "2006-01-02 15:04:05 -0700 -07" )
Variables ¶
This section is empty.
Functions ¶
func ConvertDdMmYyyyBy ¶
func EndOfMonth ¶
func FromTimestampGMT7 ¶
func GetFebruaryLastOfMonth ¶
func GetFebruaryLastOfMonth()
func GetTimeZone ¶
func GetWeekday ¶
func IsIntervalElapsed ¶
func MonthsToDays ¶
MonthsToDays Function to convert months to days considering leap years
func NowWithoutTime ¶
func ParseByLocation ¶
func ParseDdMmYyyy ¶
func ParseEndOfDay ¶
ParseEndOfDay date string 2021-09-09 to time.Time
func ParseStartOfDay ¶
ParseStartOfDay date string 2021-09-09 to time.Time
func TimeNowFormat ¶
func ValidateDateFormatDash ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.