Documentation
¶
Index ¶
- func CompareTime(timeA, timeB, timeATimezone, timeBTimezone string) (int, error)
- func ConvertTime(inputTime, inputTimezone, outputTimezone, format string) (output string, err error)
- func CurrentTime(timezone, format string) (output string, err error)
- func GetDefaultFormat() string
- func GetDefaultTimezone() string
- func GetFormats() []string
- func RelativeTime(inputTime, relativeTime, timezone, format string) (output string, err error)
- func TimeAdd(inputTime, duration, timezone, format string) (output string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareTime ¶
CompareTime compares two time strings and returns:
- -1 if timeA is before timeB
- 0 if timeA is equal to timeB
- 1 if timeA is after timeB
func ConvertTime ¶
func ConvertTime(inputTime, inputTimezone, outputTimezone, format string) (output string, err error)
ConvertTime converts a given time string from one timezone to another. If inputTimezone is empty, UTC is used as the default.
func CurrentTime ¶
CurrentTime returns the current time in the specified timezone and format.
func GetDefaultFormat ¶
func GetDefaultFormat() string
GetDefaultFormat returns the default format layout string.
func GetDefaultTimezone ¶
func GetDefaultTimezone() string
GetDefaultTimezone returns the default timezone string.
func GetFormats ¶
func GetFormats() []string
GetFormats returns a slice of all supported format names.
func RelativeTime ¶
RelativeTime parses a relative time string (e.g., "2 hours ago") based on a reference time.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.