ee.Date.unitRatio

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'.

UsageReturns
ee.Date.unitRatio(numerator, denominator)Float
ArgumentTypeDetails
numeratorString
denominatorString

Examples

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'));

See the Python Environment page for information on the Python API and using geemap for interactive development.

import ee
import geemap.core as geemap
display('Minutes in a day:', ee.Date.unitRatio('day', 'minute'))
display('Seconds in a year:', ee.Date.unitRatio('year', 'second'))
display('Years in a month:', ee.Date.unitRatio('month', 'year'))
display('Hours in a week:', ee.Date.unitRatio('week', 'hour'))