fix_hms: Transform '24:00:00' to '00:00:00' for 'hms' objects

View source: R/fix_hms.R

fix_hmsR Documentation

Transform 24:00:00 to 00:00:00 for hms objects

Description

[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

Other utility functions: change_date(), extract_seconds(), flat_posixt_date(), get_last_week(), round_time()

Examples

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

hms::parse_hm(c("02:00", "24:00", "18:00")) |> fix_hms()
02:00:00 # Expected
00:00:00
18:00:00

gipso/lubritime documentation built on April 17, 2025, 12:03 p.m.