I want to do two things.
First, I want to map the number of nights that have temperatures below 0 in one year. This code seems to do this.
Second, I want to calculate the number of days between the first and last nights with sub-zero temps. I managed to get the first one in the series but the output is a format I don't know: 994118400000.
How can I get the last night the series and measure the span of time between the first and last dates in the series?
var NightSA = ee.ImageCollection('MODIS/006/MOD11A1').select('LST_Night_1km');
var count2001 = NightSA.filterDate('2001-07-01','2002-06-30').map(function(NightSA)
{return NightSA.lt(0).set('system:time_start',
NightSA.get('system:time_start'))});
var first2001 = count2001.first().get('system:time_start');
print (first2001);
var nightSurfaceTempVis = {
min: 0,
max: 365,
palette: [
'040274', '040281', '0502a3', '0502b8', '0502ce', '0502e6',
'0602ff', '235cb1', '307ef3', '269db1', '30c8e2', '32d3ef',
'3be285', '3ff38f', '86e26f', '3ae237', 'b5e22e', 'd6e21f',
'fff705', 'ffd611', 'ffb613', 'ff8b13', 'ff6e08', 'ff500d',
'ff0000', 'de0101', 'c21301', 'a71001', '911003'
],
};
Map.addLayer(count2001.count(),nightSurfaceTempVis,'Nights < 0');