But you can convert a day precision naive-time, because it goes through zoned-time first and gets common typed up to second precision
library(clock)
nt <- as_naive_time(year_month_day(2019, 1, 1))
st <- as_sys_time(year_month_day(2019, 1, 1))
as.POSIXct(nt, "UTC")
#> [1] "2019-01-01 UTC"
as.POSIXct(st, "UTC")
#> Error: Can't floor to a more precise precision.
Created on 2021-12-21 by the reprex package (v2.0.1)
So it probably needs the same x <- vec_cast(x, vec_ptype2(x, naive_seconds())) trick that as_zoned_time.clock_naive_time() uses
But you can convert a day precision naive-time, because it goes through zoned-time first and gets common typed up to second precision
Created on 2021-12-21 by the reprex package (v2.0.1)
So it probably needs the same
x <- vec_cast(x, vec_ptype2(x, naive_seconds()))trick thatas_zoned_time.clock_naive_time()uses