repair_time: Repair a time offset

View source: R/repair_time.R

repair_timeR Documentation

Repair a time offset

Description

Repair a time offset

Usage

repair_time(
  dt,
  ref_was = "2010-03-22 20:08:00 +08",
  ref_should = "2020-12-28 07:08:00 +08",
  tz = ruODK::get_default_tz()
)

Arguments

dt

A datetime to be corrected by a time offset in format readable by lubridate::ymd_hms(), containing the timezone. E.g. "2010-03-22 20:23:47 +08".

ref_was

A reference datetime for an uncorrected date in a format readable by lubridate::ymd_hms(), containing the timezone. Default: "2010-03-22 20:08:00 +08".

ref_should

A reference datetime for the corrected ref_was in a format readable by lubridate::ymd_hms(), containing the timezone. Default: "2020-12-28 07:08:00 +08".

tz

The timezone for the corrected datetime, default: ruODK::get_default_tz().

Value

The given datetime corrected by the timedelta between ref_was and ref_should.

Examples

repair_time("2010-03-03 18:13:01 +08")

dbca-wa/etlTurtleNesting documentation built on Nov. 18, 2022, 8:03 a.m.