I am a bit confused by how the function as.POSIXct() handles milliseconds. Reproducible code with R v4.0.5 is shown below (fresh session, no packages loaded).
> options("digits.secs" = 3)
> a <- as.POSIXct("2020-09-14 00:01:39.800")
> a
[1] "2020-09-14 00:01:39.7 CEST"
> format(a, "%Y-%m-%d %H:%M:%OS3")
[1] "2020-09-14 00:01:39.799"
> b <- as.POSIXlt("2020-09-14 00:01:39.800")
> b
[1] "2020-09-14 00:01:39.8 CEST"
> format(b, "%Y-%m-%d %H:%M:%OS3")
[1] "2020-09-14 00:01:39.800"
Can anyone shed some light on this behavior? Why does as.POSIXct change my .800 ms to .799 ms? I never noticed. Can this be a bug introduced in recent R versions?