Skip to contents

Determine the type of timestamps the database supports

Usage

db_timestamp(timestamp, conn = NULL)

Arguments

timestamp

(POSIXct(1) or character(1))
The timestamp to be transformed to the database type.

conn

(DBIConnection(1))
Connection object.

Value

The given timestamp converted to a SQL-backend dependent timestamp.

Examples

  conn <- get_connection()

  db_timestamp(Sys.time(), conn)
#> <SQL> '2024-10-04 07:59:14'

  close_connection(conn)