getDate function

get simple date string

get simple date string

get simple date string in the format DDmonYYYY such as 17jul2018.

getDate(t = Sys.time(), trim = TRUE, dateFormat = "%d%b%Y", ...)

Arguments

  • t: current time in an appropriate class such as "POSIXct"

    or "POSIXt". The default is output of Sys.time().

  • trim: logical whether to trim the output of format()

    in the event that multiple values are sent for argument t.

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

  • ...: additional parameters sent to format().

Returns

character vector with simplified date string

Details

Gets the current date in a simplified text string. Use asDate() to convert back to Date object.

Examples

getDate();

See Also

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

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