Skip to content

Commit

Permalink
fixes #1483
Browse files Browse the repository at this point in the history
  • Loading branch information
rhijmans committed May 2, 2024
1 parent dcd48b7 commit 54a55eb
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 @@ -201,8 +201,8 @@ setMethod("time<-", signature(x="SpatRaster"),
y <- as.integer(substr(value, 1, 4))
m <- value - (y * 100)
} else {
y <- as.integer(strftime(value, format = "%Y"))
m <- as.integer(strftime(value, format = "%m"))
y <- as.integer(strftime(value, format = "%Y", tz=tzone))
m <- as.integer(strftime(value, format = "%m", tz=tzone))
}
if (!all(m %in% 1:12)) {
error("date<-", "months should be between 1 and 12")
Expand Down

0 comments on commit 54a55eb

Please sign in to comment.