Learn R Programming

cycleRtools (version 1.0.2)

convert_time: Reformat time.

Description

Convert time from "HH:MM:SS" format to seconds.

Usage

convert_time(x)

Arguments

x
character string; a time in (HH:)MM:SS format. HH is optional.

Value

  • a numeric time value in seconds.

Examples

Run this code
convert_time("3:21:05")       # Simple example.
convert_time("03:30:10.5")    # With decimal seconds.
convert_time("19:30.1")       # Without hours.
convert_time("19:30.1") / 60  # In minutes.

Run the code above in your browser using DataLab