ee.Date

একটি নতুন তারিখ অবজেক্ট তৈরি করে।

ব্যবহার রিটার্নস
ee.Date(date, tz ) তারিখ
যুক্তি টাইপ বিস্তারিত
date কম্পিউটেড অবজেক্ট|তারিখ|নম্বর|স্ট্রিং রূপান্তর করার তারিখ, এর মধ্যে একটি: একটি সংখ্যা (যুগ থেকে মিলিসেকেন্ডের সংখ্যা), একটি ISO তারিখ স্ট্রিং, একটি জাভাস্ক্রিপ্ট তারিখ বা একটি গণনা করা বস্তু৷
tz স্ট্রিং, ঐচ্ছিক একটি ঐচ্ছিক টাইমজোন শুধুমাত্র একটি স্ট্রিং তারিখের সাথে ব্যবহার করা হবে।

উদাহরণ

কোড এডিটর (জাভাস্ক্রিপ্ট)

// Numeric inputs are interpreted as milliseconds from Unix epoch.
print(ee.Date(0));  // Date (1970-01-01 00:00:00)

// Scale factors can make numerical inputs more readable (e.g. 60 seconds).
print(ee.Date(60 * 1000));  // Date (1970-01-01 00:01:00)

// ISO 8601 date string input examples.
print(ee.Date('2020'));  // Date (2020-01-01 00:00:00)
print(ee.Date('2017-6-24'));  // Date (2017-06-24 00:00:00)
print(ee.Date('2017-06-24'));  // Date (2017-06-24 00:00:00)
print(ee.Date('2017-6-24T00:14:46'));  // Date (2017-06-24 00:14:46)
print(ee.Date('2017-06-24T23:59:59'));  // Date (2017-06-24 23:59:59)

// With an optional time zone.
print(ee.Date('2020', 'US/Mountain'));  // Date (2020-01-01T07:00:00)

// Convert JavaScript now to Earth Engine Date
print(ee.Date(Date.now()));

পাইথন সেটআপ

পাইথন এপিআই এবং ইন্টারেক্টিভ ডেভেলপমেন্টের জন্য geemap ব্যবহার করার জন্য পাইথন এনভায়রনমেন্ট পৃষ্ঠাটি দেখুন।

import ee
import geemap.core as geemap

Colab (পাইথন)

from datetime import datetime

# Numeric inputs are interpreted as milliseconds from Unix epoch.
print(ee.Date(0).format().getInfo())  # 1970-01-01T00:00:00

# Scale factors can make numerical inputs more readable (e.g. 60 seconds).
print(ee.Date(60 * 1000).format().getInfo())  # 1970-01-01T00:01:00

# ISO 8601 date string input examples.
print(ee.Date('2020').format().getInfo())  # 2020-01-01T00:00:00
print(ee.Date('2017-6-24').format().getInfo())  # 2017-06-24T00:00:00
print(ee.Date('2017-06-24').format().getInfo())  # 2017-06-24T00:00:00
print(ee.Date('2017-6-24T00:14:46').format().getInfo())  # 2017-06-24T00:14:46
print(ee.Date('2017-06-24T23:59:59').format().getInfo())  # 2017-06-24T23:59:59

# With an optional time zone.
print(ee.Date('2020', 'US/Mountain').format().getInfo())  # 2020-01-01T07:00:00

# Convert Python datetime.now() to Earth Engine Date
print(ee.Date(datetime.now()).format().getInfo())