2

In Google Earth Engine, what is the default format of time_start for MOD10A1 image?For example,

var modisCollection = ee.ImageCollection('MODIS/006/MOD10A1')
    .filterDate('2000-08-21', '2001-02-28')
print(modisCollection.first())

var l5 = ee.ImageCollection('LANDSAT/LT05/C01/T1_SR')
  .filterDate('2000-04-28', '2001-02-28')
print(l5.first())

From the output, you can see that the MODIS system:time_start value of the image is 980985600000 and Landsat system:time_start value is 966866712747.

Are 980985600000 and 966866712747 in the same time format? If the date from MODIS (980985600000) is not in UNIX time, how do I convert to UNIX time?

See a sample code here

1 Answer 1

3

It's the number of milliseconds since the epoch (1 Jan 1970). You can convert it to an ee.Date object to use various date methods, including formatting for printing.

var modisCollection = ee.ImageCollection('MODIS/006/MOD10A1')
    .filterDate('2000-08-21', '2001-02-28')
print(ee.Date(modisCollection.first().get('system:time_start')).format("yyyy-MM-dd"))

var l5 = ee.ImageCollection('LANDSAT/LT05/C01/T1_SR')
  .filterDate('2000-04-28', '2001-02-28')
print(ee.Date(l5.first().get('system:time_start')).format("yyyy-MM-dd"))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.