dtt_second: Get and Set Second Values

View source: R/second.R

dtt_secondsR Documentation

Get and Set Second Values

Description

Gets and sets second values for date/time vectors.

Usage

dtt_seconds(x, ...)

dtt_seconds(x) <- value

dtt_second(x, ...)

dtt_second(x) <- value

## S3 method for class 'Date'
dtt_second(x, ...)

## S3 method for class 'POSIXct'
dtt_second(x, ...)

## S3 method for class 'hms'
dtt_second(x, ...)

## S3 replacement method for class 'POSIXct'
dtt_second(x) <- value

## S3 replacement method for class 'hms'
dtt_second(x) <- value

dtt_set_second(x, value)

Arguments

x

A date/time vector.

...

Unused.

value

A integer vector of the second value(s).

Value

An integer vector (or the modified date/time vector).

Methods (by class)

  • dtt_second(Date): Get integer vector of second values for a Date vector

  • dtt_second(POSIXct): Get integer vector of second values for a POSIXct vector

  • dtt_second(hms): Get integer vector of second values for a time vector

Functions

  • dtt_second(POSIXct) <- value: Set second values for a POSIXct vector

  • dtt_second(hms) <- value: Set second values for a hms vector

See Also

Other set time: dtt_hours(), dtt_minutes()

Examples

x <- as.POSIXct("1990-01-02 23:40:51")
dtt_second(x)
dtt_second(x) <- 27L
x

x <- hms::as_hms("23:40:51")
dtt_second(x)
dtt_second(x) <- 27L
x

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