No leading zeros for R months
3 answers
You can try this.
x <- as.Date(c("2005-09-02", "2005-10-20", "2010-10-20"))
gsub("0(\\d)", "\\1", format(x, "%d/%m/%y"))
# [1] "2/9/5" "20/10/5" "20/10/10"
But keep in mind that doing this on a vector of dates from different ages will be a little confusing when you come back to look at them later.
+6
source to share