ee.Date.getFraction

کسر سپری شده این تاریخ از واحد مشخص شده (بین 0 و 1) را برمی گرداند.

استفاده برمی گرداند
Date. getFraction (unit, timeZone ) شناور
استدلال تایپ کنید جزئیات
این: date تاریخ
unit رشته یکی از «سال»، «ماه»، «هفته»، «روز»، «ساعت»، «دقیقه» یا «دوم».
timeZone رشته، پیش فرض: null منطقه زمانی (به عنوان مثال، "America/Los_Angeles")؛ پیش فرض UTC است.

نمونه ها

ویرایشگر کد (جاوا اسکریپت)

var date = ee.Date('2021-4-30T07:15:31.24');

print('Elapsed fraction of a year', date.getFraction('year'));
print('Elapsed fraction of a month', date.getFraction('month'));
print('Elapsed fraction of a week', date.getFraction('week'));
print('Elapsed fraction of a day', date.getFraction('day'));
print('Elapsed fraction of an hour', date.getFraction('hour'));
print('Elapsed fraction of a minute', date.getFraction('minute'));
print('Elapsed fraction of a second', date.getFraction('second'));

راه اندازی پایتون

برای اطلاعات در مورد API پایتون و استفاده از geemap برای توسعه تعاملی به صفحه محیط پایتون مراجعه کنید.

import ee
import geemap.core as geemap

کولب (پایتون)

date = ee.Date('2021-4-30T07:15:31.24')

display('Elapsed fraction of a year:', date.getFraction('year'))
display('Elapsed fraction of a month:', date.getFraction('month'))
display('Elapsed fraction of a week:', date.getFraction('week'))
display('Elapsed fraction of a day:', date.getFraction('day'))
display('Elapsed fraction of an hour:', date.getFraction('hour'))
display('Elapsed fraction of a minute:', date.getFraction('minute'))
display('Elapsed fraction of a second:', date.getFraction('second'))