Skip to contents

[Maturing]

fix_hms() is a quick fix for hms objects that have a time of 24:00:00. This function transforms the time to 00:00:00 for consistency with the POSIXt class.

Usage

fix_hms(x)

Arguments

x

A hms vector.

Value

A hms vector.

See also

Examples

hms::parse_hm("24:00") |> fix_hms()
#> 00:00:00
#> 00:00:00 # Expected

hms::parse_hm(c("02:00", "24:00", "18:00")) |> fix_hms()
#> 02:00:00
#> 00:00:00
#> 18:00:00
02:00:00 # Expected
#> Warning: numerical expression has 3 elements: only the first used
#> [1] 2 1 0
00:00:00
#> [1] 0
18:00:00
#> Warning: numerical expression has 19 elements: only the first used
#>  [1] 18 17 16 15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0