ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / TimeDelta Class / TimeDelta Constructor
Example

In This Topic
    TimeDelta Constructor
    In This Topic
    Initialize a new instance of a TimeDelta using a value and a time unit.
    Syntax
    public TimeDelta( 
       double value,
       TimeUnit timeUnit
    )
    Public Function New( _
       ByVal value As Double, _
       ByVal timeUnit As TimeUnit _
    )

    Parameters

    value
    timeUnit
    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);
    }
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also