0

I'm reading those dates in R thru excel (R version 3.5.0 Patched), system = x86_64, mingw32

I have some dates in column Activate_Date i.e. 2023-04-23, 2023-04-24, 2023-04-25, 43998, 44650, 44848

also I have some dates in another column Deactivate_Date i.e. 2023-04-23 15:20:01, 2023-04-24 17:20:01, 2023-04-25 13:20:01, 00:02.0, 00:50.0, 13:54.2

I want to convert those dates which are not in date format in to date format.

Any one help me to get this done.

On Activate_Date I tried as.numeric then as.Date(x, origin = '1900-01-01') then Activate_Date -2

but showing all the dates as NULL means the dates which are correct in format that also showing NULL

On Deactivate_Date I tried as.Date function but showing error "Error in charToDate(x) : character string is not in a standard unambiguous format"

unable to install library anytime bcoz we don't have internet access on our server. Even unable to seperate non-dates & dates to check bcoz dataframe having bunch of records.

any other solution

Thanks in Advance.

  • 1
    (1) `R version 3.5.0`, is there a reason you're sticking with a version over five years old? (2) `2023-04-25` and `43998` look easy, `2023-04-23 15:20:01` looks more like a timestamp than a date, but `00:02.0, 00:50.0, 13:54.2` ... not sure if that should be a `Period` (time-frame from `lubridate`) or something else. See https://stackoverflow.com/a/52319606/3358272 (dates), https://stackoverflow.com/a/70304571/3358272 (POSIXct) for examples of how to deal with _most_ of that. – r2evans May 03 '23 at 18:17

0 Answers0