In [1]:
import ee
ee.Initialize()

In [2]:
from geetools import tools

In [3]:
import ipygee as ui

In [4]:
test_image = ee.Image('LANDSAT/LT05/C01/T1_SR/LT05_226087_20000102')

get_date_band

Get the date of an image, compute how many units (for example day) has ellpsed since the epoch (1970-01-01) and set it to a band (called date) and a property (called unit_since_epoch, for example, day_since_epoch)


In [5]:
date_band = tools.date.getDateBand(test_image, 'day')

In [6]:
ui.eprint(date_band)


date_since_epoch

Given an ellapsed time since epoch (for example the result of get_date_band) compute what day it is


In [7]:
image_date = date_band.get('day_since_epoch')
date_since_epoch = tools.date.dateSinceEpoch(image_date)

In [8]:
ui.eprint(date_since_epoch)


unit_since_epoch

Return the number of unit (for example, day) since the epoch (1970-1-1)


In [9]:
date = ee.Date('2000-01-02')

In [10]:
days = tools.date.unitSinceEpoch(date)

In [11]:
ui.eprint(days)



In [ ]: