format_datetime: Readable date format to POSIX

Description Usage Arguments Value Examples

View source: R/format_datetime.R

Description

Use this function to transform generic date/time info writing (dd-mm-yyyy) into POSIX standardised format (%d-%m-%Y), see Examples.

Usage

1

Arguments

format

the format that needs to be transformed

Value

A character string (a POSIX standardised format)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
format_datetime("yyyy-mm-dd")

# Very hard to remember all these characters:
format(Sys.time(), "%a %b %d %Y %X")

# Easy to remember and write the same as above:
format(Sys.time(), format_datetime("ddd mmm dd yyyy HH:MM:ss"))

# seconds since the Epoch, 1970-01-01 00:00:00
format(Sys.time(), format_datetime("epoch"))

cleaner documentation built on June 13, 2021, 5:06 p.m.