dec_time2nice_time: Convert a decimal time to a nice-looking time

Description Usage Arguments Value Note Examples

View source: R/dec_time2nice_time.R

Description

Goes from hours.fraction format to hours:minutes.

Usage

1
dec_time2nice_time(dec_times, clock = "12hr")

Arguments

dec_times

A numeric vector with length >= 1, and values in the interval [0,24].

clock

A character vector specifying if you want a 12-hour clock ("12hr") or a 24-hour clock(i.e., miliary time; "24hr").

Value

A character vector with the converted times. If clock == "12hr", either "AM" or "PM" will be included at the end of the character string in each element.

Note

Any cases where dec_times == 0 | dec_times == 24 will be converted to "12:00AM" if clock == "12hr" and "0:00" if clock == "24hr".

Examples

1
2
dec_time2nice_time(c(2.25, 14.55), "12hr")
dec_time2nice_time(c(2.25, 14.55), "24hr")

bstaton1/StatonMisc documentation built on May 18, 2020, 12:06 a.m.