Contents

RelativeDateTimeFormatter

A formatter that creates locale-aware string representations of a relative date or time.

Declaration

class RelativeDateTimeFormatter

Overview

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

Configuring Formatter Options

See Also

Dates and times