powered by
Formats a date safely, returning a fallback value (na) when the input is NULL or NA.
na
NULL
NA
whapi_fmt_date(x, fmt = "%d/%m/%Y", na = "-")
A formatted date string, or the na placeholder if missing.
Date or coercible to Date.
Date
Date format passed to base::format().
base::format()
Fallback string if the input is missing.
whapi_fmt_date(Sys.Date()) #> "31/08/2025" whapi_fmt_date(NA) #> "-"
Run the code above in your browser using DataLab