Cldr.DateTime.Formatter.millisecond
You're seeing just the function
millisecond
, go back to Cldr.DateTime.Formatter module for more information.
Specs
millisecond(Calendar.time(), integer(), Keyword.t()) :: String.t() | {:error, String.t()}
Returns the time
(format symbol A
) as millisenconds since
midnight.
Arguments
time
is aTime
struct or any map that contains at least the key:second
with and optional:microsecond
key of the format used byTime
n
is the number of fractional digits to which the float number of seconds is roundedlocale
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 inmillisecond/4
Format Symbol
The representation of the milliseconds
is made in accordance with the following
table:
Symbol | Results | Description |
---|---|---|
A+ | "4000" | Minimum necessary digits of milliseconds since midnight |
Examples
iex> Cldr.DateTime.Formatter.millisecond %{hour: 0, minute: 0,
...> second: 4, microsecond: {2000, 3}}, 1
"4002"
iex> Cldr.DateTime.Formatter.millisecond %{hour: 0, minute: 0, second: 4}, 1
"4000"
iex> Cldr.DateTime.Formatter.millisecond %{hour: 10, minute: 10, second: 4}, 1
"36604000"
iex> Cldr.DateTime.Formatter.millisecond ~T[07:35:13.215217]
"27313215"
Specs
millisecond(Calendar.time(), integer(), locale(), Cldr.backend(), Keyword.t()) :: String.t() | {:error, String.t()}