ee.Date.parse

แยกวิเคราะห์สตริงวันที่โดยพิจารณาจากสตริงที่อธิบายรูปแบบของวันที่

การใช้งานการคืนสินค้า
ee.Date.parse(format, date, timeZone)วันที่
อาร์กิวเมนต์ประเภทรายละเอียด
formatสตริงรูปแบบตามที่อธิบายไว้ใน http://joda-time.sourceforge.net/apidocs/org/joda/time/format/DateTimeFormat.html
dateสตริงสตริงที่ตรงกับรูปแบบที่ระบุ
timeZoneสตริง ค่าเริ่มต้น: nullเขตเวลา (เช่น 'America/Los_Angeles'); เริ่มต้นเป็น UTC

ตัวอย่าง

เครื่องมือแก้ไขโค้ด (JavaScript)

print(ee.Date.parse('yyyy MM dd', '2021 4 30'));
print(ee.Date.parse('yyyy-MM-dd', '2021-4-30'));
print(ee.Date.parse('yyyy/MM/dd', '2021/4/30'));
print(ee.Date.parse('MM/dd/yy', '4/30/21'));
print(ee.Date.parse('MMM. dd, yyyy', 'Apr. 30, 2021'));
print(ee.Date.parse('yyyy-MM-dd HH:mm:ss', '2021-4-30 00:00:00'));

การตั้งค่า Python

ดูข้อมูลเกี่ยวกับ Python API และการใช้ geemap สําหรับการพัฒนาแบบอินเทอร์แอกทีฟได้ที่หน้า สภาพแวดล้อม Python

import ee
import geemap.core as geemap

Colab (Python)

display(ee.Date.parse('YYYY MM dd', '2021 4 30'))
display(ee.Date.parse('YYYY-MM-dd', '2021-4-30'))
display(ee.Date.parse('YYYY/MM/dd', '2021/4/30'))
display(ee.Date.parse('MM/dd/YY', '4/30/21'))
display(ee.Date.parse('MMM. dd, YYYY', 'Apr. 30, 2021'))
display(ee.Date.parse('YYYY-MM-dd HH:mm:ss', '2021-4-30 00:00:00'))