Learn R Programming

DIZutils (version 0.0.13)

format_posixct: 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

Run this code
# 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"
)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab