ee.Date.unitRatio

傳回一個單位長度與另一個單位長度的比率,例如 unitRatio('day', 'minute') 會傳回 1440。有效的單位為「year」、「month」、「week」、「day」、「hour」、「minute」、「second」。

用量傳回
ee.Date.unitRatio(numerator, denominator)浮點值
引數類型詳細資料
numerator字串
denominator字串

範例

程式碼編輯器 (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'));

Python 設定

請參閱「 Python 環境」頁面,瞭解 Python API 和如何使用 geemap 進行互動式開發。

import ee
import geemap.core as geemap

Colab (Python)

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