0

In my dataframe I have a variable in a date format like this: "Fri Oct 23 15:51:20 +0000 2020". I want to make it a bit simpler, so it looks like this 2020-10-23the Y-M-D format.

What would be the right way to do it? I first converted the variable to a character variable and the substring it, then I have a "Oct 23 15:51:20 +0000 2020". How would I remove the timestamp so I could convert to the Y-M-D format?

Thanks in advance!

Phil
  • 5,491
  • 3
  • 26
  • 61
grethcool
  • 1
  • 1
  • Welcome to StackOverflow! There are (literally) hundreds of identical questions already here in the ~15 year history of StackOverflow. You can use the search bar with a string like this `[r] as.Date format is:answer` which would look for _answers_ with the _R language tag_ containing terms `as.Date` (the function you need to use) and its `format` argument. – Dirk Eddelbuettel Oct 29 '21 at 13:33

0 Answers0