Description Usage Arguments Details Value Examples
format_time
takes either a numeric or character input s
,
corresponding to some time, and returns a string that is formatted to a
consistent HH:MM:SS
format.
1 |
time |
Either a single numeric, corresponding to some number of seconds,
or a character string where hours, minutes, and/or seconds are separated by
a colon ( |
format_time
is flexible with regard to the format of time
,
but if hours and/or minutes are supplied in addition to seconds, they must
be some form where mintues precede seconds, and hours precede minutes.
Thus, to indicate 1 hour, 30 minutes, 5 seconds, the following values of
time
are all acceptable: "1:30:05"
, 5405
,
"5405"
, "30:3605"
, "1.5:0:5"
. However,
1.5:05
, is not.
a character string of the form HH:MM:SS
.
1 2 3 4 5 6 7 8 9 10 11 | format_time(2.5) # fractions are okay
# Many different ways to express "01:30:05":
format_time("1:30:05") # 1 hour, 30 minutes, 5 seconds
format_time(5405) # 5405 seconds (numeric)
format_time("5405") # 5405 seconds (string)
format_time("30:3605") # 30 minutes, 3605 seconds
format_time("1.5:0:5") # 1.5 hours, 0 minutes, 5 seconds
# Order is important
format_time("1.5:5") # 1.5 minutes, 5 seconds
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.