# NOT RUN {
s <- rast(system.file("ex/logo.tif", package="terra"))
# Date"
d <- as.Date("2001-05-04") + 0:2
time(s) <- d
time(s)
# POSIX (time stored as seconds)
time(s) <- as.POSIXlt(d)
time(s)
# "raw" time
time(s) <- as.numeric(d)
time(s)
# }
Run the code above in your browser using DataLab