ee.Date.getRelative

Returns the specified (0-based) unit of this date relative to a larger unit, e.g. getRelative('day', 'year') returns a value between 0 and 365.

UsageReturns
Date.getRelative(unit, inUnit, timeZone)Long
ArgumentTypeDetails
this: dateDate

unitString

One of 'month' 'week', 'day', 'hour', 'minute', or 'second'.

inUnitString

One of 'year', 'month' 'week', 'day', 'hour', or 'minute'.

timeZoneString, default: null

The time zone (e.g. 'America/Los_Angeles'); defaults to UTC.