resetTimePart: Reduce a Timestamp to a certain Information

Description Usage Arguments Examples

View source: R/main.R

Description

Reduce a Timestamp to a certain Information

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
resetTimePart(
  tstamp,
  resetYear = FALSE,
  resetMonth = FALSE,
  resetDay = FALSE,
  resetTime = FALSE,
  resetHour = resetTime,
  resetMin = resetTime,
  resetSec = resetTime,
  ...
)

Arguments

tstamp

(vector of) timestamp(s) of type POSXIXt

resetYear

logical. If TRUE, the year of all timestamps is set to 1970

resetMonth

logical. If TRUE, the month of all timestamps is set to 01

resetDay

logical. If TRUE, the day of all timestamps is set to 01

resetTime

logical. Used as default for resetHour, resetMin, resetSec

resetHour

logical. If TRUE, the hours of all timestamps is set to 00

resetMin

logical. If TRUE, the minutes of all timestamps is set to 00

resetSec

logical. If TRUE, the seconds of all timestamps is set to 00

...

further arguments to be passed to hsToPosix

Examples

1
2
3
4
resetTimePart(as.POSIXct("2017-11-04 16:18:44"), resetTime = TRUE)

# Reset year, month and day
resetTimePart(as.POSIXct("2017-11-04 16:18:44"), TRUE, TRUE, TRUE)

KWB-R/kwb.datetime documentation built on July 9, 2021, 10:28 p.m.