getUnitSinceEpoch#

geetools.ee_date.DateAccessor.getUnitSinceEpoch(unit='day')#

Get the number of units since epoch (1970-01-01).

Parameters:

unit (str) – The unit to return the number of. One of: second, minute, hour, day, month, year.

Returns:

The number of units since the epoch.

Return type:

ee.Number

Examples

import ee, geetools
from geetools.utils import initialize_documentation

initialize_documentation()

d = ee.Date('2020-01-01').geetools.getUnitSinceEpoch('year')
d.getInfo()
49