0

I have a column with date in the format 20201020 (AAAAMMDD) as integer and a need to format as date 2020-10-20.

I`ve tried:

as.Date(MYDATE, format = "%m/%d/%y", origin = "1900-01-01")

AND

format(MYDATE, "%m/%d/%Y")

But returned just

NA
Ronak Shah
  • 355,584
  • 18
  • 123
  • 178
andhherson
  • 27
  • 4

1 Answers1

0

Using lubridate we can:

ymd(MY_DATE)
zx8754
  • 46,390
  • 10
  • 104
  • 180
andhherson
  • 27
  • 4