convert date DDmmmYYYY to Date

asDate(getDateValues, dateFormat = "%d%b%Y", ...)

Arguments

getDateValues

character date, in format recognized by dateFormat

dateFormat

character string representing the recognized date format, by default "DDmmmYYYY", which recognizes "23aug2007".

...

additional parameters are ignored.

Value

Date object

Details

This function converts a text date string to Date object, mainly to allow date-related math operations, for example difftime.

See also

Other jam date functions: dateToDaysOld(), getDate()

Examples

asDate(getDate());
#>    10aug2023 
#> "2023-08-10"