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