date_format: Formatted dates and times.

Description Usage Arguments Examples

View source: R/formatter.r

Description

Formatted dates and times.

Usage

1
2
3
date_format(format = "%Y-%m-%d", tz = "UTC")

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

Arguments

format

Date/time format using standard POSIX specification. See strptime() for possible formats.

tz

a time zone name, see timezones(). Defaults to UTC

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
a_time <- ISOdatetime(2012, 1, 1, 11, 30, 0, tz = "UTC")
a_date <- as.Date(a_time)

date_format()(a_date)
date_format(format = "%A")(a_date)

time_format()(a_time)
time_format(tz = "Europe/Berlin")(a_time)

a_hms <- hms::as.hms(a_time, tz = "UTC")
time_format(format = "%H:%M")(a_hms)

scales documentation built on Aug. 10, 2018, 1:17 a.m.