r-logging icon indicating copy to clipboard operation
r-logging copied to clipboard

Failure on trying to log dates

Open abudis opened this issue 3 years ago • 1 comments

Hey 👋

I noticed that logging started to fail when I pass dates:

loginfo(as.Date("2022-01-01"))
Error in as.Date.default(e) : 
  do not know how to convert 'e' to class "Date"

I think this happened once I upgraded R to 4.1.2 from 3.6.3.

Is that a known issue, or are we not supposed to pass dates anymore?

Thanks!

abudis avatar Jan 18 '22 15:01 abudis

Hi. I was checking how was doing this project of mine, and I thought I would review some open issues. This one does not look related to r-logging, but to the conversion from string to Date in your system. I'm using R 4.0.4 (2021-02-15) for duplicating your error and on my system the conversion from string to Date seems to go through as.Date.character, not as.Date.default. If I force execution of as.Date.default("2022-01-01")) I get the same error as yours. Anyhow, the error occurs before you enter the r-logging code. My 2¢ hint: try to understand why you're hitting as.Date.default, it may be some setting somewhere (sorry if I can't offer you more help) and consider explicitly invoking as.Date.character in your code.

mfrasca avatar May 20 '24 13:05 mfrasca