time: Determine Time from Seconds (& vice versa)

seconds2timeR Documentation

Determine Time from Seconds (& vice versa)

Description

time2seconds() and seconds2time() determine the time (format="hh:mm:ss.ss") from the value in seconds or vice versa. Two digit hour precision optional.

Usage

seconds2time(x)

time2seconds(x)

Arguments

x

Character or Numeric. Of the form "hh:mm:ss.ss" with 2 decimal point precision on the seconds to convert to seconds. If numeric, the seconds to convert to a character string of the form "hh:mm:ss.ss".

Value

Either number of seconds (numeric) or the time format (character) as "hh:mm:ss.ss".

Author(s)

Stu Field

See Also

strsplit(), grep()

Examples

seconds2time(159.72)

time2seconds("3:44:12.04")
time2seconds("15:44:12.04")

stufield/stuRpkg documentation built on April 2, 2022, 2:05 p.m.