% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dt2_formats.R
\name{dt2_format_datetime}
\alias{dt2_format_datetime}
\title{Format date/time columns (DataTables renderer: datetime)}
\usage{
dt2_format_datetime(
  options = list(),
  col_specs,
  from = NULL,
  to = "DD/MM/YYYY",
  locale = NULL,
  def = NULL
)
}
\arguments{
\item{options}{List of options (returned with \code{columnDefs} updated).}

\item{col_specs}{Column names or 1-based indices.}

\item{from}{Input format (e.g., \code{"YYYY-MM-DD"} or ISO8601 by default).}

\item{to}{Output format (e.g., \code{"DD/MM/YYYY"}).}

\item{locale}{Optional locale (e.g., \code{"pt-BR"}).}

\item{def}{Optional default output if input is invalid.}
}
\value{
Modified \code{options}.
}
\description{
Use DataTables' built-in \code{DataTable.render.datetime} to transform
date/time strings for display (and preserve sortability).
}
\examples{
opts <- list(columns = c("when", "val"))
opts <- dt2_format_datetime(opts, "when", from = "YYYY-MM-DD",
                            to = "DD/MM/YYYY", locale = "pt-BR")
}
