R: Convert h:m:s To/From Seconds

hms2sec {qdapTools} | R Documentation

## Convert h:m:s To/From Seconds

### Description

`hms2sec` - Converts a vector of h:m:s to seconds.

`sec2hms` - Converts a vector of seconds to h:m:s.

### Usage

    hms2sec(x)

    sec2hms(x)

### Arguments

`x` | A vector of times in h:m:s (for `hms2sec`) or seconds (for `sec2hms`) .

### Value

`hms2sec` - Returns a vector of times in seconds.

`sec2hms` - Returns a vector of times in h:m:s format.

### See Also

`times`

### Examples

    hms2sec(c("02:00:03", "04:03:01"))
    hms2sec(sec2hms(c(222, 1234, 55)))
    sec2hms(c(256, 3456, 56565))

[Package qdapTools version 1.3.3 Index]