dtt_floor: Floor Date/Time

View source: R/floor.R

dtt_floorR Documentation

Floor Date/Time

Description

Floors a date/time vector

Usage

dtt_floor(x, units, ...)

## S3 method for class 'Date'
dtt_floor(x, units = "days", ...)

## S3 method for class 'POSIXct'
dtt_floor(x, units = "seconds", ...)

## S3 method for class 'hms'
dtt_floor(x, units = "seconds", ...)

Arguments

x

A date/time vector.

units

A string of the time units. The possible values are "secs", "minutes", "hours", "days" or "weeks".

...

Unused.

Value

The floored date/time vector.

Methods (by class)

  • dtt_floor(Date): Floor a Date vector

  • dtt_floor(POSIXct): Floor a POSIXct vector

  • dtt_floor(hms): Floor a hms vector

See Also

Other floor: dtt_date(), dtt_date_time(), dtt_excel_to_date(), dtt_floored(), dtt_set_time()

Examples

dtt_floor(hms::as_hms("23:59:59"), "hours")

dttr2 documentation built on Sept. 26, 2024, 1:06 a.m.