ee.Date.getFraction

지정된 단위의 이 날짜의 경과 시간 분율 (0과 1 사이)을 반환합니다.

사용반환 값
Date.getFraction(unit, timeZone)부동 소수점 수
인수유형세부정보
this: date날짜
unit문자열'year', 'month', 'week', 'day', 'hour', 'minute', 'second' 중 하나입니다.
timeZone문자열, 기본값: null시간대 (예: 'America/Los_Angeles'); 기본값은 UTC입니다.

코드 편집기 (JavaScript)

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'));

Python 설정

Python API 및 대화형 개발을 위한 geemap 사용에 관한 자세한 내용은 Python 환경 페이지를 참고하세요.

import ee
import geemap.core as geemap

Colab (Python)

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'))