datetimeformat: Date and Time formatting for text output

format_dateR Documentation

Date and Time formatting for text output

Description

Date and Time formatting for text output

Usage

format_date(x, format = "%m/%d/%Y", tz = "UTC")

format_time(x, format = "%H:%M:%S", tz = "UTC")

Arguments

x

POSIXct values

format

A format string. see base::format.

tz

A time zone string, defaults to UTC (Univeral)

Details

These functions simply provide a shorthand for the most common formats.

Value

The date or time formatted as text

Examples

format_date(Sys.time())
format_date(Sys.time(), format="%Y-%m-%d T %H:%M")
format_time(Sys.time())

qPharmetra/PMDatR documentation built on April 7, 2024, 5:42 p.m.