Learn R Programming

clean (version 1.1.0)

format_datetime: Readable date format to POSIX

Description

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

Usage

format_datetime(format)

Arguments

format

the format that needs to be transformed

Value

A character string (a POSIX standardised format)

Examples

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

Run the code above in your browser using DataLab