ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • ヘルプ
  • Sign Out
ArcGIS Desktop

ArcGIS Online

組織のマッピング プラットフォーム

ArcGIS Desktop

完全なプロ仕様の GIS

ArcGIS Enterprise

エンタープライズ GIS

ArcGIS Developers

位置情報利用アプリの開発ツール

ArcGIS Solutions

各種業界向けの無料のテンプレート マップおよびテンプレート アプリケーション

ArcGIS Marketplace

組織で使えるアプリとデータを取得

  • ドキュメント
  • サポート
Esri
  • サイン イン
user
  • マイ プロフィール
  • サイン アウト

ArcMap

  • ホーム
  • はじめに
  • マップ
  • 解析
  • データ管理
  • ツール
  • エクステンション

EsriTimeDelta

  • 概要
  • ディスカッション
  • 構文
  • プロパティ
  • コードのサンプル

概要

The EsriTimeDelta class represents a duration, the difference between two dates or times.

ディスカッション

The EsriTimeDelta class is an alternative to the core Python datetime.timedelta and uses internal Esri time units for intervals that can't be handled by the core Python timedelta object (such as months, weeks, and so on).

The timeStepInterval property from the LayerTime and DataFrameTime classes return EsriTimeDelta objects.

レガシー:

Prior to the 10.1 release, the timeStepInterval property from the DataFrameTime class returned core Python datetime.timedelta objects.

構文

EsriTimeDelta
 (interval, units)
パラメーター説明データ タイプ
interval

The interval of the EsriTimeDelta.

Double
units

The units of the EsriTimeDelta. Valid units are milliseconds, seconds, minutes, hours, days, weeks, months, years, decades, and centuries.

String

プロパティ

プロパティ説明データ タイプ
interval
(読み取り専用)

The interval of the EsriTimeDelta.

Double
units
(読み取り専用)

The units of the EsriTimeDelta.

String

コードのサンプル

EsriTimeDelta example 1

The following script accesses the time-step interval property of a time-enabled layer in a map document. The time-step interval is an EsriTimeDelta object. The script then prints EsriTimeDelta properties.

import arcpy
mxd = arcpy.mapping.MapDocument('C:/Project/Temperature.mxd')
df = arcpy.mapping.ListDataFrames(mxd, 'USA')[0]
lyr = arcpy.mapping.ListLayers(mxd,'temperature', df)[0]
tsi = lyr.time.timeStepInterval
print "Time Step Interval:", tsi
print "EsriTimeDelta interval:", tsi.interval
print "EsriTimeDelta units:", tsi.units
EsriTimeDelta example 2

The following script uses the EsriTimeDelta object to iterate through twelve months starting from the current date.

import arcpy, datetime

time = datetime.datetime.now()

for delta in range(1, 13):
    next_date = time + arcpy.time.EsriTimeDelta(1 * delta, "months")
    print next_date
EsriTimeDelta example 3

The following script shows how the EsriTimeDelta handles leap years. The script adds a month to January 31, 2008 and returns February 29, 2008.

import arcpy, datetime

time = datetime.datetime(2008, 1, 31)

for delta in range(0, 12):
    next_date = time + arcpy.time.EsriTimeDelta(delta, "months")
    print next_date
    delta = delta + 1

ArcGIS Desktop

  • ホーム
  • ドキュメント
  • サポート

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

Esri について

  • 会社概要
  • 採用情報
  • Esri ブログ
  • ユーザ カンファレンス
  • デベロッパ サミット
Esri
ご意見・ご感想をお寄せください。
Copyright © 2021 Esri. | プライバシー | リーガル