R: Convert month and 2 digit year into date
问题 How can this date string be converted in R and lubridate ? lubridate::as_date('Apr-78', format = '%B-%Y') How to prevent the error invalid 'tz' ? 回答1: lubridate::parse_date_time("Apr-78", 'my') 回答2: Others have already mentioned that your format isn't quite correct, so watch out for that. As far as timezones are concerned: My first thought was that you simply need to add tz = "UTC" (or some other timezone), but the fact that your date has no day information is the bigger issue. If you don't