Documentation ¶
Index ¶
- Constants
- func BeginningOfNextDay(date time.Time) time.Time
- func ConvertToNoDateTimeString(timeString *string) (*string, error)
- func CurrentDate() time.Time
- func CurrentLocation() *time.Location
- func DateDBFormattedString(date time.Time) string
- func DateDBFormattedStringDateOnly(date time.Time) string
- func DateEqual(date1, date2 time.Time) bool
- func DateLayoutDB() string
- func DateLayoutFilenameSafe() string
- func DateLayoutForDB() string
- func DateLayoutHumanReadable() string
- func DateLayoutHumanReadableWithTime() string
- func DateLayoutTime() string
- func DateLayoutTrimmed() string
- func DateLayoutYearMonthDay() string
- func DateLayoutYearMonthDayTime() string
- func DateLayoutYearMonthDayTimeMillisecondTZ() string
- func DateLayoutYearMonthDayTimeT() string
- func DateLayoutYearMonthDayTimeTZ() string
- func DateLayoutYearMonthDayTimeTimezone() string
- func DateLocal(date *time.Time)
- func DatePtrToString(date *time.Time) string
- func DatePtrToTimeString(date *time.Time) string
- func EndOfDay(date time.Time) time.Time
- func FormatTimestampsWithTimeZoneOnStructRecursively(object any, location *time.Location) error
- func ParseTimeString(timeString string) (time.Time, error)
- func StartOfDay(date time.Time) time.Time
- func TimeBefore(a string, b string) bool
- func TodayEnd() string
- func TodayStart() string
- type TradingHours
- type TradingHoursDay
Constants ¶
View Source
const TimeZoneString = "Africa/Johannesburg"
Variables ¶
This section is empty.
Functions ¶
func BeginningOfNextDay ¶ added in v1.233.0
BeginningOfNextDay is useful for specifying intervals where the beginning of the next day is excluded e.g. date < beginningOfNextDay
func ConvertToNoDateTimeString ¶
ConvertToNoDateTimeString - Converts a PSQL Time type to Go Time type
func CurrentDate ¶
func CurrentLocation ¶
func DateDBFormattedString ¶
func DateLayoutDB ¶
func DateLayoutDB() string
func DateLayoutFilenameSafe ¶
func DateLayoutFilenameSafe() string
func DateLayoutForDB ¶
func DateLayoutForDB() string
func DateLayoutHumanReadable ¶
func DateLayoutHumanReadable() string
func DateLayoutHumanReadableWithTime ¶
func DateLayoutHumanReadableWithTime() string
func DateLayoutTime ¶
func DateLayoutTime() string
func DateLayoutTrimmed ¶
func DateLayoutTrimmed() string
func DateLayoutYearMonthDay ¶
func DateLayoutYearMonthDay() string
func DateLayoutYearMonthDayTime ¶
func DateLayoutYearMonthDayTime() string
func DateLayoutYearMonthDayTimeMillisecondTZ ¶
func DateLayoutYearMonthDayTimeMillisecondTZ() string
func DateLayoutYearMonthDayTimeT ¶
func DateLayoutYearMonthDayTimeT() string
func DateLayoutYearMonthDayTimeTZ ¶
func DateLayoutYearMonthDayTimeTZ() string
func DateLayoutYearMonthDayTimeTimezone ¶
func DateLayoutYearMonthDayTimeTimezone() string
func DatePtrToString ¶ added in v1.233.0
DatePtrToString converts a time.Time pointer to a string in the format "2006-01-02 15:04:05".
func DatePtrToTimeString ¶ added in v1.233.0
DatePtrToTimeString converts a time.Time pointer to a string in the format "15:04". If the pointer is nil, it returns "--:--".
func FormatTimestampsWithTimeZoneOnStructRecursively ¶ added in v1.150.0
func ParseTimeString ¶
ParseTimeString attempts to parse the string as the default date-time format, or as a date only format
func TimeBefore ¶
TimeBefore determines whether a (string format HH:mm) is earlier than b (string format HH:mm)
func TodayStart ¶ added in v1.233.0
func TodayStart() string
Types ¶
type TradingHours ¶ added in v1.206.0
type TradingHours struct { Monday TradingHoursDay `json:"monday"` Tuesday TradingHoursDay `json:"tuesday"` Wednesday TradingHoursDay `json:"wednesday"` Thursday TradingHoursDay `json:"thursday"` Friday TradingHoursDay `json:"friday"` Saturday TradingHoursDay `json:"saturday"` Sunday TradingHoursDay `json:"sunday"` Holidays TradingHoursDay `json:"holidays"` }
func (TradingHours) String ¶ added in v1.208.0
func (t TradingHours) String() string
func (TradingHours) Validate ¶ added in v1.208.0
func (t TradingHours) Validate() error
type TradingHoursDay ¶ added in v1.250.0
type TradingHoursDay struct { StartTime string `json:"start_time"` EndTime string `json:"end_time"` }
func (TradingHoursDay) String ¶ added in v1.250.0
func (day TradingHoursDay) String() string
func (TradingHoursDay) Validate ¶ added in v1.250.0
func (day TradingHoursDay) Validate() error
Click to show internal directories.
Click to hide internal directories.