ee.Date.fromYMD

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

用法返回
ee.Date.fromYMD(year, month, day, timeZone)日期
参数类型详细信息
year整数例如,2013 年。
month整数月份,例如 3。
day整数日期,例如 15。
timeZone字符串,默认值:null时区(例如,“America/Los_Angeles”);默认为 UTC。

示例

代码编辑器 (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 API 和如何使用 geemap 进行交互式开发,请参阅 Python 环境页面。

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