get_minute: Numerical Minute of the Day.

View source: R/AGread_Dates&Times.R

get_minuteR Documentation

Numerical Minute of the Day.

Description

Converts a timestamp to a numerical value between 0 (midnight) and 1439 (23:59). Seconds can be represented using a rational decimal.

Usage

get_minute(timestamp, format = "%Y-%m-%d %H:%M:%S", rational = FALSE)

Arguments

timestamp

A character or POSIX-formatted vector containing timestamp information

format

The date-time format of timestamp, if it is a character vector

rational

A logical scalar. Use rational number to represent seconds?

Value

numerical value(s) representing the minute of the day in the interval [0, 1440)

Examples

key_times <-
    paste("2018-03-15",
          c("00:00:00",
            "01:00:00",
            "12:00:00",
            "23:59:59"))

get_minute(key_times)
get_minute(key_times, rational = TRUE)


AGread documentation built on Sept. 13, 2022, 5:06 p.m.