ee.Date.fromYMD

傳回指定年、月、日的日期。

用量傳回
ee.Date.fromYMD(year, month, day, timeZone)日期
引數類型詳細資料
year整數例如 2013 年。
month整數月份,例如 3。
day整數例如 15 號。
timeZone字串,預設值為空值時區 (例如「America/Los_Angeles」);預設為世界標準時間。

範例

程式碼編輯器 (JavaScript)

print('Date with default UTC',
      ee.Date.fromYMD(2021, 4, 30));

print('Date with time zone specified',
      ee.Date.fromYMD(2021, 4, 30, 'America/Los_Angeles'));

Python 設定

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

import ee
import geemap.core as geemap

Colab (Python)

display('Date with default UTC:', ee.Date.fromYMD(2021, 4, 30))

display(
    'Date with time zone specified:',
    ee.Date.fromYMD(2021, 4, 30, 'America/Los_Angeles')
)