Skip to contents

[Stable]

Usage

isodt_to_local(
  datetime_string,
  orders = c("YmdHMS", "YmdHMSz"),
  tz = get_default_tz(),
  quiet = TRUE
)

Arguments

datetime_string

(character) An ISO8601 datetime string as produced by XForms exported from ODK Central.

orders

(vector of character) Orders of datetime elements for lubridate. Default: c("YmdHMS", "YmdHMSz", "Ymd HMS", "Ymd HMSz").

tz

A timezone to convert dates and times to.

Read vignette("setup", package = "ruODK") to learn how ruODK's timezone can be set globally or per function.

quiet

(lgl) Used in lubridate::parse_date_time(quiet=quiet) to suppress warnings from attempting to parse all empty values or columns. Run with quiet=FALSE to show any lubridate warnings.

Value

A lubridate PosixCT datetime in the given timezone.

Details

This function is used internally by ruODK to parse ISO timestamps to timezone-aware local times.

Warnings are suppressed through lubridate::parse_date_time(quiet=TRUE).