asDate function

convert date DDmmmYYYY to Date

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.

Returns

Date object

Details

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

Examples

asDate(getDate());

See Also

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

  • Maintainer: James M. Ward
  • License: MIT + file LICENSE
  • Last published: 2025-03-23