Datetimes_as_strings: Functions to Extract Dates and Times as Strings

Datetimes_as_stringsR Documentation

Functions to Extract Dates and Times as Strings

Description

Functions that extract the current date and time (in UTC) and convert them to formatted strings.

Usage

camr_ymd(sep = "_")

camr_ymd_hm(sep = "_", split = "-")

camr_ymd_hms(sep = "_", split = "-")

camr_hms(sep = "_")

Arguments

sep

A character string, the separator between the year, month, day, and/or hour, minutes, and seconds.

split

A character string, the separator between the date and the time.

Value

A character string.

Author(s)

Kevin Potter

Examples

# YYYY_MM_DD
camr_ymd()
# YYYY-MM-DD
camr_ymd('-')
# YYYYMMDD
camr_ymd('')

# YYYY_MM_DD-HH_MM
camr_ymd_hm()
# YYYYMMDD-HHMM
camr_ymd_hm('')
# YYYYMMDD_HHMM
camr_ymd_hm('', '_')

# YYYY_MM_DD-HH_MM_SS
camr_ymd_hms()
# YYYYMMDD-HHMMSS
camr_ymd_hms('')
# YYYYMMDD_HHMMSS
camr_ymd_hm('', '_')

# HH_MM_SS
camr_hms()
# HH:MM:SS
camr_hms(':')

rettopnivek/camrprojects documentation built on March 26, 2024, 9:17 a.m.