0

How can use date format with time zone from 8 AM to 8 AM data download ?

var inidate = ee.Date.fromYMD(2020,03,17)
var enddate = ee.Date.fromYMD(2020,03,18)

enter code hereenter link here

2
  • Sorry, I am not able to understand what you are trying to do... Can you please explain a bit more? Mar 18, 2020 at 13:43
  • I want to dawnlod rainfall data from 8 am to nextday 8 am how can use data format to dawnlod data 24 hr ( for ex : 2020/03/17 : 8am to 2020/3/18 : 8 am ) Mar 18, 2020 at 13:49

1 Answer 1

1

You could use client-side Dates to generate initdate and enddate in millis, and filter on system:time_start:

var initdate = new Date('2020-03-16').setUTCHours(8)
var enddate = new Date('2020-03-17').setUTCHours(7) // 7 to exclude 8 for next day maybe?

var gsmap = ee.ImageCollection('JAXA/GPM_L3/GSMaP/v6/operational')
  .filter(ee.Filter.rangeContains('system:time_start', initdate, enddate))
  .select('hourlyPrecipRate');
4
  • thanks for your answer , but i get error when i run the code ( enddate.difference is not a function) Mar 18, 2020 at 15:13
  • You haven't shared your assets, so I haven't been able to run your code. You use inidate and enddate for other things, so maybe something like this would be better (again, I cannot run the script, so I'm not 100% this is correct): code.earthengine.google.com/3dc0592771f79e8251ff1b5084a71ad1 Mar 18, 2020 at 15:21
  • In your script, initdate and enddate were ee.Date instances, I turned them into longs (which don't have a difference() function). The link in my last comment keeps initdate and enddate as ee.Date but do the image filtering using long timestamps. Mar 18, 2020 at 15:33
  • sorry brother i don't know how can solve this error Mar 18, 2020 at 16:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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