ArcGIS Pro 3.1 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / TimeDelta Class
Members Example

In This Topic
    TimeDelta Class
    In This Topic
    Represents a time interval defined by a positive or negative value and a unit of time.
    Syntax
    public class TimeDelta 
    Public Class TimeDelta 
    Remarks
    Similar to System.TimeSpan this class offers advantages in that it can represent time intervals that are not uniform in time, for example months or years. TimeRange.Offset and other members accepting TimeDelta as an input are able to account and handle these irregular time periods like months or years when calculating new dates and times.
    Example
    Step forward in time by 1 month
    public void StepMapTime()
    {
      //Get the active view
      MapView mapView = MapView.Active;
      if (mapView == null)
        return;
    
      //Step current map time forward by 1 month
      TimeDelta timeDelta = new TimeDelta(1, TimeUnit.Months);
      mapView.Time = mapView.Time.Offset(timeDelta);
    }
    
    Inheritance Hierarchy

    System.Object
       ArcGIS.Desktop.Mapping.TimeDelta

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.0 or higher.
    See Also