# NOT RUN {
# getting the capturing date from the name of a Landsat-8 image
file.ls8 <- "LC82000312017010LGN01.tar.gz"
date.ls8 <- lsGetDates(file.ls8)
print(date.ls8)
print(format(date.ls8, "%Y%j"))
# getting the capturing date from the name of a Landsat-7 and a Landsat-8
# image
file.ls7 <- c("LE72330822017009ASN01")
date.ls7 <- lsGetDates(file.ls7)
print(date.ls7)
# }
Run the code above in your browser using DataLab