Documentation ¶
Index ¶
- func AddDateTime(now any, offset string) (ts time.Time, err error)
- func DecodeC8yTimestamp(value string) string
- func EncodeC8yTimestamp(value string) string
- func FormatC8yDate(timestamp time.Time, encode bool, layout string) string
- func FormatC8yTimestamp(timestamp time.Time, encode bool) string
- func GetTimestampUsingOffset(now time.Time, offsetDuration string) (*time.Time, error)
- func ParseDuration(duration string) (time.Duration, error)
- func ParseDurationRelativeToNow(offsetDuration string) (*time.Time, error)
- func ParseTimestamp(value string) (ts time.Time, err error)
- func TryGetDate(value string, encode bool, layout string) (string, error)
- func TryGetTimestamp(value string, encode bool, utc bool) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDateTime ¶ added in v2.35.0
AddDateTime adds an offset to a given timestamp (either as string or time.Time)
func DecodeC8yTimestamp ¶
func EncodeC8yTimestamp ¶
func GetTimestampUsingOffset ¶
GetTimestampUsingOffset returns a timestamp relative to a base timestamp example: +1d3w4mo-7y6h4m
func ParseDuration ¶
ParseDuration converts a duration string representation to a time.Duration The duration is in reference to now.
func ParseDurationRelativeToNow ¶
ParseDurationRelativeToNow returns a timestamp relative to now Examples ParseDurationRelativeToNow("-1m")
func ParseTimestamp ¶
ParseTimestamp parse a time stamp (accepts both relative and full timestamps)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.