ee.Date.fromYMD

Stay organized with collections Save and categorize content based on your preferences.
Returns a Date given year, month, day.

UsageReturns
ee.Date.fromYMD(year, month, day, timeZone)Date
ArgumentTypeDetails
yearInteger
monthInteger
dayInteger
timeZoneString, default: nullThe time zone (e.g. 'America/Los_Angeles'); defaults to UTC.

Examples

Code Editor (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'));

Colab (Python)

print('Date with default UTC:',
      ee.Date.fromYMD(2021, 4, 30).format().getInfo())

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