dtt_seconds {dttr2}R 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)

Functions

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

[Package dttr2 version 0.5.0 Index]