ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Calculate End Time

  • Summary
  • Illustration
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Calculates the end time of features based on the time values stored in another field.

In the illustration below, the end time values in the End_Time field are calculated using the time values in the Start_Time field. The end time value for a feature is equal to the start time of the next feature. However, for the last feature in the table, the end time value is calculated to be the same as the start time value of the feature.

Illustration

Calculate End Time illustration

Usage

  • The table is first sorted by the fields in the ID Fields parameter, then by the Start Time Field. After this sort, the end time of any row is the same as the start time of the next row.

  • This tool is useful when the intervals between Start Time Field values are not regular and you want to visualize the feature class or table through time using the time slider. See the topics A quick tour of temporal data management and visualization and Irregularly spaced temporal data for more information.

  • The End Time Field value for the last row will be the same as the Start Time Field value for that row.

Syntax

CalculateEndTime_management (in_table, start_field, end_field, {fields})
ParameterExplanationData Type
in_table

The feature class or table for which an End Time Field is calculated based on the Start Time Field specified.

Table View
start_field

The field containing values that will be used to calculate values for the End Time Field. The Start Time Field and the End Time Field must be of the same type. For example, if the Start Time Field is of type LONG, then the End Time Field should be of type LONG as well.

Field
end_field

The field that will be populated with values based on the Start Time Field specified. The Start Time Field and the End Time Field must be of the same format.

Field
fields
[fields,...]
(Optional)

The name of the field or fields that can be used to uniquely identify spatial entities. These fields are used to first sort based on entity type if there is more than one entity. For instance, for a feature class representing population values per state over time, the state name could be the unique value field (the entity). If population figures are per county, you would need to set the county name and state name as the unique value fields, since some county names are the same for different states. If there is only one entity, this parameter can be ignored.

Field

Code sample

CalculateEndTime example (Python window)

The following Python window script demonstrates how to use the CalculateEndTime tool in immediate mode.

import arcpy
arcpy.CalculateEndTime_management("C:/Data/TemporalData.gdb/CalculateEndTime","Start_Time","End_Time","")
CalculateEndTime example 2 (stand-alone script)

The following stand-alone script demonstrates how to use the CalculateEndTime tool.

# Name: CalculateEndTime_Ex02.py
# Description: Calculate end time based on a start time field
# Requirements: None

# Import system modules
import arcpy

# Set local variables
inTable = "C:/Data/TemporalData.gdb/CalculateEndTime"
uniqueIdFields = ""
startTimeField = "Start_Time"
endTimeField = "End_Time"
 
# Execute CalculateEndDate
arcpy.CalculateEndTime_management(inTable, startTimeField, endTimeField, uniqueIdFields)

Environments

  • Current Workspace

Licensing information

  • ArcGIS for Desktop Basic: Yes
  • ArcGIS for Desktop Standard: Yes
  • ArcGIS for Desktop Advanced: Yes

Related topics

  • An overview of the Fields toolset

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal