MyApp.Cldr.DateTime.Relative.to_string-exclamation-mark

You're seeing just the function to_string-exclamation-mark, go back to MyApp.Cldr.DateTime.Relative module for more information.
Link to this function

to_string!(time, options \\ [])

View Source

Specs

to_string!(number() | map(), Keyword.t()) :: String.t()

Returns a {:ok, string} representing a relative time (ago, in) for a given number, Date or Datetime or raises an exception on error.

Arguments

  • relative is a number or Date/Datetime representing the time distance from now or from options[:relative_to].

  • options is a Keyword list of options.

Options

  • :locale is the locale in which the binary is formatted. The default is Cldr.get_locale/0

  • :style is the format of the binary. Style may be :default, :narrow or :short. The default is :default

  • :unit is the time unit for the formatting. The allowable units are :second, :minute, :hour, :day, :week, :month, :year, :mon, :tue, :wed, :thu, :fri, :sat, :sun, :quarter

  • :relative_to is the baseline Date or Datetime from which the difference from relative is calculated when relative is a Date or a DateTime. The default for a Date is Date.utc_today, for a DateTime it is DateTime.utc_now

See to_string/2