Learn R Programming

DIZutils (version 0.0.12)

get_current_timestamp: Quickly get the current timestamp

Description

Function to quickly get the current timestamp without need to handle format-options etc.

Usage

get_current_timestamp(no_spaces = FALSE)

Arguments

no_spaces

Boolean. Default = `FALSE`. Specifies wether 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 filenames (e.g. logfiles), `no_spaces = TRUE` might be a good option.

Value

The current timestamp in always the same format. #'

Examples

Run this code
# NOT RUN {
get_current_timestamp(no_spaces = TRUE)
# Result: "2020-12-03-134354"
get_current_timestamp()
# this is the same like
get_current_timestamp(no_spaces = FALSE)
# Result: "03.12.2020 - 13:43 UTC"

# }

Run the code above in your browser using DataLab