format_utc: Format Date and POSIXct

Description Usage Arguments Value See Also Examples

View source: R/date-time.R

Description

Converts Date and POSIXct objects to the format given as input.

Usage

1
format_utc(x, format = NULL, usetz = TRUE)

Arguments

x

A Date or POSIXct object to be converted.

format

A character string. The default format is "%Y-%m-%d" for Date and "%Y-%m-%d %H:%M:%S" for POSIXct.

usetz

Logical. If TRUE, the time zone abbreviation is appended to the output. Applicable only if an POSIXct object.

Value

A character string representing the formatted date.

See Also

format.Date, format.POSIXct

Examples

1
format_utc(Sys.time(), format = "%Y-%m-%d", usetz = FALSE)

numeract/Nmisc documentation built on April 29, 2021, 9:56 a.m.