6

In R, I can parse a date into Lubridate format using:

d <- ymd("2013-02-15")

How do I output this in yyyyMMdd format, e.g.:

20130215

The equivalent .NET command would be:

.ToString("yyyyMMdd")

I know the answer to this will be simple, but I've spent the last hour attempting to find any reference to outputting dates with Lubridate with no success so far.

Contango
  • 76,540
  • 58
  • 260
  • 305

1 Answers1

5
format(d, "%Y%m%d")

yields

> format(d, "%Y%m%d")
[1] "20130215"
Brian Diggs
  • 57,757
  • 13
  • 166
  • 188