ee.Date

Constructs a new Date object.

UsageReturns
ee.Date(date, tz)Date
ArgumentTypeDetails
dateComputedObject|Date|Number|String

The date to convert, one of: a number (number of milliseconds since the epoch), an ISO Date string, a JavaScript Date or a ComputedObject.

tzString, optional

An optional timezone only to be used with a string date.

Examples

JavaScript

print(ee.Date(0));  // Date (1970-01-01 00:00:00)
print(ee.Date(60000));  // Date (1970-01-01 00:01:00) - 1 hour past the epoch

// Multiply seconds by 1000 to get milliseconds
print(ee.Date(1496794486 * 1000));  // Date (2017-06-07 00:14:46)

print(ee.Date('2020'));  // Date (2020-01-01 00:00:00)
print(ee.Date('2017-6-7'));  // Date (2017-06-07 00:00:00)
print(ee.Date('2017-06-07'));  // Date (2017-06-07 00:00:00)
print(ee.Date('2017-6-7T00:14:46'));  // Date (2017-06-07 00:14:46)
print(ee.Date('2017-06-07T23:59:59'));  // Date (2017-06-07 23:59:59)

// Convert JavaScript now to Earth Engine Date
print(ee.Date(Date.now()));

Python

# Your example goes here!