format_posixct: Formats a given POSIXct timestamp without the need of...

View source: R/format_POSIXct.R

format_posixctR Documentation

Formats a given POSIXct timestamp without the need of manually specifing format parameters.

Description

See title.

Usage

format_posixct(x, lang = "en", date = TRUE, time = TRUE)

Arguments

x

The POSIXct timestamp or a string to be automatically converted to a POSIXct timestamp.

lang

(Optional, String, Default = "en") The language of the result. Currently implemented: "en"/"de". If you supply another not yet implemented language here, "en" will be chosen automatically.

date

(Optional, Boolean, Default = TRUE) Should the date be part of the result string?

time

(Optional, Boolean, Default = TRUE) Should the time be part of the result string?

Value

(String) The formatted timestamp as a string.

Examples

## Not run: 
format_POSIXct(x = "2021-12-31 12:34")
## Result: "2021-12-31, 12:34:00"
format_POSIXct(x = "2021-12-31 12:34", lang = "de")
## Result: "31.12.2021, 12:34:00"
format_posixct(Sys.time())
## Result: "2022-01-01, 09:10:50"
)
## End(Not run)


DIZtools documentation built on Sept. 18, 2023, 9:07 a.m.