Skip to contents

Translates between Postgres, Sqlite, Snowflake & R timezones to adjust for timezone treatment between different databases

Usage

cdr_adj_timezone(conn_pool)

Arguments

conn_pool

database connection of type pool

Value

an OlsonNames() timezone for R and lubridate

Details

Postgres timezone ref: 'https://www.postgresql.org/docs/8.1/datetime-keywords.html'

Snowflake is always: 'UTC'

Sqlite is always an empty string: "" (not 'UTC')

Examples

if (FALSE) {
conn_pool <- pool::dbPool(
  DBI::dbConnect( RPostgreSQL::PostgreSQL(),
                  dbname = "test",
                  host = "localhost",
                  port = "5432",
                  user = Sys.getenv('postgres_username'),
                  password = Sys.getenv('postgres_password'))
)
crudr:::cdr_adj_timezone(conn_pool)
pool::poolClose(conn_pool)
}