ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / TimeRange Class / Offset Method
The time interval to offset the current instance by.
Example

In This Topic
    Offset Method (TimeRange)
    In This Topic
    Returns a new time range offset from the current instance using the specified time interval.
    Syntax
    public TimeRange Offset( 
       TimeDelta timeDelta
    )
    Public Function Offset( _
       ByVal timeDelta As TimeDelta _
    ) As TimeRange

    Parameters

    timeDelta
    The time interval to offset the current instance by.

    Return Value

    A new TimeRange that is equal to this instance offset by the time interval represented by timeDelta.
    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