ee.Date.get

מחזירה את היחידה שצוינה בתאריך הזה.

שימושהחזרות
Date.get(unit, timeZone)ארוך
ארגומנטסוגפרטים
זה: dateתאריך
unitמחרוזתאחת מהאפשרויות הבאות: year,‏ month (מחזירה ערך בין 1 ל-12),‏ week (מחזירה ערך בין 1 ל-53),‏ day (מחזירה ערך בין 1 ל-31),‏ hour (מחזירה ערך בין 0 ל-23),‏ minute (מחזירה ערך בין 0 ל-59) או second (מחזירה ערך בין 0 ל-59).
timeZoneמחרוזת, ברירת מחדל: nullאזור הזמן (למשל, ‫'America/Los_Angeles'); ברירת המחדל היא UTC.

דוגמאות

עורך הקוד (JavaScript)

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

print('Year', date.get('year'));
print('Month', date.get('month'));
print('Week', date.get('week'));
print('Day', date.get('day'));
print('Hour', date.get('hour'));
print('Minute', date.get('minute'));
print('Second', date.get('second'));

הגדרת Python

מידע על Python API ועל שימוש ב-geemap לפיתוח אינטראקטיבי מופיע בדף Python Environment.

import ee
import geemap.core as geemap

Colab (Python)

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

display('Year:', date.get('year'))
display('Month:', date.get('month'))
display('Week:', date.get('week'))
display('Day:', date.get('day'))
display('Hour:', date.get('hour'))
display('Minute:', date.get('minute'))
display('Second:', date.get('second'))