hms.to.seconds-deprecated

0th

Percentile

Converts a time value given in H:M:S format to the number of seconds since midnight

This function is very similar to strptime with the %X conversion specification. Anything with three numbers between two colons is interpreted as a time, no consistency check is performed on the actual hour, minute and second values. Thus, strings like 25:15:00 and 23:78:101 also will be converted. Incorrectly formatted strings are converted to NA with a warning.

Usage
hms.to.seconds(x)
Arguments
x

A (vector of) strings in H:M:S format.

Value

A (vector of) integer values of the same length as x.

See Also

base::strptime()

Other deprecated functions: coalesce.na-deprecated, df_to_list-deprecated, kimisc-deprecated, list_to_df-deprecated, nc-deprecated, nlist-deprecated, ofactor-deprecated, sample.rows-deprecated, seconds.to.hms-deprecated, thisfile-deprecated, tll-deprecated, vswitch-deprecated

Aliases
  • hms.to.seconds-deprecated
  • hms.to.seconds
Examples
# NOT RUN {
hms.to.seconds(c("00:00:01", "00:01:00", "01:00:00"))
hms.to.seconds(c("25:15:00", "23:78:101"))
hms.to.seconds("invalid")
# }
Documentation reproduced from package kimisc, version 0.4, License: GPL-3

Community examples

Looks like there are no examples yet.