Cldr.DateTime.Formatter.second
You're seeing just the function
second
, go back to Cldr.DateTime.Formatter module for more information.
Specs
second(Calendar.time(), integer(), Keyword.t()) :: String.t() | {:error, String.t()}
Returns the :second
of a time
or datetime
(format symbol s
) as number
in string format. The number of s
's in the format determines the formatting.
Arguments
time
is aTime
struct or any map that contains at least the key:second
n
is the number of digits to which:hour
is paddedlocale
is any valid locale name returned byCldr.known_locale_names/0
or aCldr.LanguageTag
struct. The default isCldr.get_locale/0
options
is aKeyword
list of options. There are no options used insecond/4
Format Symbol
The representation of the second
is made in accordance with the following
table:
Symbol | Results | Description |
---|---|---|
s | 3, 48 | Minimim digits of seconds |
ss | "03", "48" | Number of seconds zero-padded to 2 digits |
Examples
iex> Cldr.DateTime.Formatter.second %{second: 23}, 1
"23"
iex> Cldr.DateTime.Formatter.second %{second: 4}, 2
"04"
Specs
second(Calendar.time(), integer(), locale(), Cldr.backend(), Keyword.t()) :: String.t() | {:error, String.t()}