numberAsHMS: Convert a Numeric Time to Hour, Minute, and Second

Description Usage Arguments Value Author(s) See Also Examples

View source: R/oce.R

Description

Convert a Numeric Time to Hour, Minute, and Second

Usage

1
numberAsHMS(t, default = 0)

Arguments

t

a vector of factors or character strings, in the format 1200 for 12:00, 0900 for 09:00, etc.

default

value to be used for the returned hour, minute and second if there is something wrong with the input value (e.g. its length exceeds 4 characters, or it contains non-numeric characters)

Value

A list containing hour, minute, and second, the last of which is always zero.

Author(s)

Dan Kelley

See Also

Other things related to time: ctimeToSeconds(), julianCenturyAnomaly(), julianDay(), numberAsPOSIXct(), secondsToCtime(), unabbreviateYear()

Examples

1
2
t <- c("0900", "1234")
numberAsHMS(t)

oce documentation built on Jan. 9, 2022, 1:06 a.m.