RelativeDateTimeFormatter
A formatter that creates locale-aware string representations of a relative date or time.
Declaration
class RelativeDateTimeFormatterOverview
Use the strings that the formatter produces, such as “1 hour ago”, “in 2 weeks”, “yesterday”, and “tomorrow” as standalone strings. Embedding them in other strings may not be grammatically correct.
Topics
Converting Dates to Formatted Strings
localizedString(for:relativeTo:)localizedString(from:)localizedString(fromTimeInterval:)string(for:)