Skip to content

Commit

Permalink
for #1483
Browse files Browse the repository at this point in the history
  • Loading branch information
rhijmans committed May 2, 2024
1 parent 54a55eb commit d4d68fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/time.R
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,14 @@ setMethod("time<-", signature(x="SpatRaster"),
if (is.numeric(value)) {
value <- posix_from_ym(value, "6")
} else {
value <- as.integer(strftime(value, format = "%Y"))
value <- as.integer(strftime(value, format = "%Y", tz=tzone))
value <- posix_from_ym(value, "6")
}
} else if (tstep == "months") {
if (is.numeric(value)) {
value <- floor(value)
} else {
value <- as.integer(strftime(value, format = "%m"))
value <- as.integer(strftime(value, format = "%m", tz=tzone))
}
if (!all(value %in% 1:12)) {
error("date<-", "months should be between 1 and 12")
Expand Down

0 comments on commit d4d68fc

Please sign in to comment.