Returns the ratio of the length of one unit to the length of another, e.g. unitRatio('day', 'minute') returns 1440. Valid units are 'year', 'month' 'week', 'day', 'hour', 'minute', and 'second'.
Usage | Returns | ee.Date.unitRatio(numerator, denominator) | Float |
Argument | Type | Details | numerator | String | |
denominator | String | |
Examples
Code Editor (JavaScript)
print('Minutes in a day', ee.Date.unitRatio('day', 'minute'));
print('Seconds in a year', ee.Date.unitRatio('year', 'second'));
print('Years in a month', ee.Date.unitRatio('month', 'year'));
print('Hours in a week', ee.Date.unitRatio('week', 'hour'));