Documentation
¶
Index ¶
- func ValidateTimezoneAvailability() error
- type Time
- func (t Time) ANSIC() string
- func (t Time) Add(d time.Duration) Time
- func (t Time) After(u Time) bool
- func (t Time) Before(u Time) bool
- func (t Time) CST() time.Time
- func (t Time) Central() time.Time
- func (t Time) DateOnly() string
- func (t Time) EST() time.Time
- func (t Time) EUDateLong() string
- func (t Time) EUDateShort() string
- func (t Time) EUDateTime12() string
- func (t Time) EUDateTime24() string
- func (t Time) EUTime12() string
- func (t Time) EUTime24() string
- func (t Time) Eastern() time.Time
- func (t Time) Equal(u Time) bool
- func (t Time) Format(layout string) string
- func (t Time) ISO8601() string
- func (t Time) IsZero() bool
- func (t Time) Kitchen() string
- func (t Time) MST() time.Time
- func (t *Time) MarshalJSON() ([]byte, error)
- func (t Time) MonthLong() string
- func (t Time) MonthShort() string
- func (t Time) Mountain() time.Time
- func (t Time) PST() time.Time
- func (t Time) Pacific() time.Time
- func (t Time) RFC3339() string
- func (t Time) RFC3339Nano() string
- func (t Time) RFC822() string
- func (t Time) RFC822Z() string
- func (t Time) RFC850() string
- func (t *Time) Scan(value interface{}) error
- func (t *Time) String() string
- func (t Time) Sub(u Time) time.Duration
- func (t Time) TimeFormat(layout TimeLayout) string
- func (t Time) TimeOnly() string
- func (t Time) USDateLong() string
- func (t Time) USDateShort() string
- func (t Time) USDateTime12() string
- func (t Time) USDateTime24() string
- func (t Time) USTime12() string
- func (t Time) USTime24() string
- func (t Time) UTC() time.Time
- func (t *Time) UnmarshalJSON(data []byte) error
- func (t *Time) Value() (driver.Value, error)
- func (t Time) WeekdayLong() string
- func (t Time) WeekdayShort() string
- type TimeLayout
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateTimezoneAvailability ¶
func ValidateTimezoneAvailability() error
ValidateTimezoneAvailability checks if all timezone locations were properly initialized Returns nil if initialization was successful, otherwise returns the initialization error
Types ¶
type Time ¶
Time is an alias for time.Time that defaults to UTC time.
func ParseRFC3339 ¶
ParseRFC3339 parses a time string in RFC3339 format and returns a utc.Time
func ParseRFC3339Nano ¶
ParseRFC3339Nano parses a time string in RFC3339Nano format and returns a utc.Time
func (Time) EUDateLong ¶
EUDateLong formats time as "2 January 2006"
func (Time) EUDateShort ¶
EUDateShort formats time as "02/01/2006"
func (Time) EUDateTime12 ¶
EUDateTime12 formats time as "02/01/2006 03:04:05 PM"
func (Time) EUDateTime24 ¶
EUDateTime24 formats time as "02/01/2006 15:04:05"
func (*Time) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for utc.Time.
func (Time) RFC3339Nano ¶
RFC3339Nano formats time as "2006-01-02T15:04:05.999999999Z07:00"
func (*Time) Scan ¶
Scan implements the sql.Scanner interface for database operations for utc.Time It does this by scanning the value into a time.Time, converting the time.Time to UTC, and then assigning the UTC time to the utc.Time.
func (*Time) String ¶
String implements the Stringer interface for utc.Time. It prints the time in RFC3339 format.
func (Time) TimeFormat ¶
func (t Time) TimeFormat(layout TimeLayout) string
TimeFormat formats the time using the specified layout
func (Time) USDateLong ¶
USDateLong formats time as "January 2, 2006"
func (Time) USDateShort ¶
USDateShort formats time as "01/02/2006"
func (Time) USDateTime12 ¶
USDateTime12 formats time as "01/02/2006 03:04:05 PM"
func (Time) USDateTime24 ¶
USDateTime24 formats time as "01/02/2006 15:04:05"
func (*Time) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for utc.Time
type TimeLayout ¶
type TimeLayout string
const ( TimeLayoutUSDateShort TimeLayout = "01/02/2006" TimeLayoutUSDateLong TimeLayout = "January 2, 2006" TimeLayoutUSDateTime12 TimeLayout = "01/02/2006 03:04:05 PM" TimeLayoutUSDateTime24 TimeLayout = "01/02/2006 15:04:05" TimeLayoutUSTime12 TimeLayout = "3:04 PM" TimeLayoutUSTime24 TimeLayout = "15:04" TimeLayoutEUDateShort TimeLayout = "02/01/2006" TimeLayoutEUDateLong TimeLayout = "2 January 2006" TimeLayoutEUDateTime12 TimeLayout = "02/01/2006 03:04:05 PM" TimeLayoutEUDateTime24 TimeLayout = "02/01/2006 15:04:05" TimeLayoutEUTime12 TimeLayout = "3:04 PM" TimeLayoutEUTime24 TimeLayout = "15:04" TimeLayoutDateOnly TimeLayout = "2006-01-02" TimeLayoutTimeOnly TimeLayout = "15:04:05" TimeLayoutWeekdayLong TimeLayout = "Monday" TimeLayoutWeekdayShort TimeLayout = "Mon" TimeLayoutMonthLong TimeLayout = "January" TimeLayoutMonthShort TimeLayout = "Jan" )
Add layout constants at package level