format_hyfe_time: Format and create date/time variables

Description Usage Arguments Value Examples

View source: R/format_hyfe_time.R

Description

Create a table of standard date/time variables for downstream Hyfe functions. This function is not usually called by an R users; it's a background function called by other hyfer utilities. But it can be handy if you have some timestamps that you want to format quickly.

Usage

1

Arguments

timestamps

A numeric vector of integer timestamps. It is assumed that these timestamps represent seconds since 00:00:00 UTC on January 1, 1970,which is the standard format of hyfe_data objects.

timezone

A character vector for the timezone, which must match one of the timezones listed in OlsonNames(). Most users will retrieve this timezone from hyfe_data$cohort_settings$timezone.

Value

A dataframe with various date/time variables. See details here.

Examples

1
2
3
4
format_hyfe_time(1626851363)
format_hyfe_time(1626851363, 'UTC')
format_hyfe_time(1626851363, 'Africa/Kampala')
format_hyfe_time(1626851363, 'America/Chicago')

hyfe-ai/hyfer documentation built on Dec. 20, 2021, 5:53 p.m.