pretty_timestamp: Quickly get a pretty timestamp without need to handle...

View source: R/pretty_timestamp.R

pretty_timestampR Documentation

Quickly get a pretty timestamp without need to handle format-options etc.

Description

Function to quickly get a pretty timestamp without need to handle format-options etc.

Usage

pretty_timestamp(timestamp, no_spaces = FALSE)

Arguments

timestamp

A POSIXct timestamp or a string which ca be converted to a POSIXct timestamp.

no_spaces

Boolean. Default = 'FALSE'. Specifies whether the output can contain spaces or not. E.g. if the output is for human reading, 'no_spaces = FALSE' is a good option. As suffix for file names (e.g. logfiles), 'no_spaces = TRUE' might be a good option.

Value

The timestamp in always the same format. #'

Examples

pretty_timestamp("2023-10-30 12:34:56", no_spaces = TRUE)
# Result: "2023-10-30T123456"
pretty_timestamp("2023-10-30 12:34:56")
# this is the same like
pretty_timestamp("2023-10-30 12:34:56", no_spaces = FALSE)
# Result: "30. Oct 2023 - 12:34 UTC"


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