Is there a way to use the format function on a date object, specifically an object of class POSIXlt, POSIXct, or Date, wi
format
POSIXlt
POSIXct
Date
A more general solution using gsub, to remove leading zeros from the day or month digits produced by %m or %d. This deletes any zero that is not preceded by a digit:
gsub("(\\D)0", "\\1", format(as.Date("1998-09-02"), "%Y, %m, %d"))