date_utils

package
v1.216.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const TimeZoneString = "Africa/Johannesburg"

Variables

This section is empty.

Functions

func ConvertToNoDateTimeString

func ConvertToNoDateTimeString(timeString *string) (*string, error)

ConvertToNoDateTimeString - Converts a PSQL Time type to Go Time type

func CurrentDate

func CurrentDate() time.Time

func CurrentLocation

func CurrentLocation() *time.Location

func DateDBFormattedString

func DateDBFormattedString(date time.Time) string

func DateDBFormattedStringDateOnly

func DateDBFormattedStringDateOnly(date time.Time) string

func DateEqual

func DateEqual(date1, date2 time.Time) bool

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 DateLocal

func DateLocal(date *time.Time)

func FormatTimestampsWithTimeZoneOnStructRecursively added in v1.150.0

func FormatTimestampsWithTimeZoneOnStructRecursively(object any, location *time.Location) error

func ParseTimeString

func ParseTimeString(timeString string) (time.Time, error)

ParseTimeString attempts to parse the string as the default date-time format, or as a date only format

func TimeBefore

func TimeBefore(a string, b string) bool

TimeBefore determines whether a (string format HH:mm) is earlier than b (string format HH:mm)

Types

type TradingHours added in v1.206.0

type TradingHours []struct {
	StartTime string `json:"start_time"`
	EndTime   string `json:"end_time"`
}

TradingHours represents an array of (StartTime,EndTime) pairs, one for each day of the week. The array is 0 indexed, with 0 being Sunday and 6 being Saturday and 7 being public 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

Jump to

Keyboard shortcuts

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