# MTPCTimeSpan

Specifies a time range for effective dates and availability dates.

See also MTProductOffering, MTRateSchedule, and MTSubscription.

To view an object model diagram that includes MTPCTimeSpan, click here.

## Program ID

Metratech.MTPCTimeSpan.1

## Methods

SetStartDateNull | Sets the start date to NULL (infinite), a NULL start date means that any date in the past is effective.
IsStartDateNull | Returns true if the start date is NULL (infinite).
SetEndDateNull | Sets the end date to NULL (infinite), a NULL end date means that any date in the future is effective.
IsEndDateNull | Returns true if the end date is NULL (infinite).
IsEndBeforeStart | Returns true if the end date is before the start date.
Validate | Normalizes members and validates properties. On failure a user error will be raised.

## Properties

Properties | Gets all (core and extended) properties of this object in a collection of MTProperty objects.
PropertyID | The unique (database) ID.
StartdateType | Uses the MTPCDateType enum type to specify the type of start date.
StartDate | For an ABSOLUTE start date type, this property specifies the start date. For a NEXT_BILLING_PERIOD start date type, this property specifies the date that determines the next billing period.
StartOffset | Only for SUBSCRIPTION_RELATIVE start date type: the number of days after start of subscription.
EndDateType | Uses the MTPCDateType enum type to specify the type of end date.
EndDate | For an ABSOLUTE end date type, this property specifies the end date. For a NEXT_BILLING_PERIOD end date type, this property specifies the date that determines the next billing period.
EndOffset | Only for SUBSCRIPTION_RELATIVE end date type: the number of days after start subscription.

# Method Detail

## SetStartDateNull

This method sets the start date to NULL (infinite), a NULL start date means that any date in the past is effective.

### Visual Basic Syntax

SetStartDateNull()

### C++ Syntax

HRESULT SetStartDateNull();

## IsStartDateNull

This method returns true if the start date is NULL (infinite).

### Visual Basic Syntax

IsStartDateNull() As Boolean

### C++ Syntax

HRESULT IsStartDateNull([out, retval] VARIANT_BOOL* pVal);

## SetEndDateNull

This method sets the end date to NULL (infinite), a NULL end date means that any date in the future is effective.

### Visual Basic Syntax

SetEndDateNull()

### C++ Syntax

HRESULT SetEndDateNull();

## IsEndDateNull

This method returns true if the end date is NULL (infinite).

### Visual Basic Syntax

IsEndDateNull() As Variant

### C++ Syntax

HRESULT IsEndDateNull([out, retval] VARIANT_BOOL* pVal);

## IsEndBeforeStart

This method returns true if the end date is before the start date.

### Visual Basic Syntax

IsEndBeforeStart() As Variant

### C++ Syntax

HRESULT IsEndBeforeStart([out, retval] VARIANT_BOOL* pVal);

## Validate

This method normalizes members and validates properties. On failure a user error will be raised.

### Visual Basic Syntax

Validate()

### C++ Syntax

HRESULT Validate();

# Property Detail

## Properties

This property gets all (core and extended) properties of this object in a collection of MTProperty objects.

### Visual Basic Syntax

Property Properties As MTProperties

### C++ Syntax

HRESULT Properties([out, retval] IMTProperties **pVal);

## PropertyID

This property specifies the unique (database) ID.

### Visual Basic Syntax

Property ID As Long

### C++ Syntax

HRESULT ID([out, retval] long *pVal);

HRESULT ID([in] long newVal);

## StartdateType

This property uses the MTPCDateType enum type to specify the type of start date.

Note that if a date is not set, its DateType is PCDATE_TYPE_NO_DATE (=0)

If a date means infinite start or end, its DateType is PCDATE_TYPE_NULL (=4)

### Visual Basic Syntax

Property StartDateType As MTPCDateType

### C++ Syntax

HRESULT StartDateType([out, retval] MTPCDateType *pVal);

HRESULT StartDateType([in] MTPCDateType newVal);

## StartDate

As the MT Platform is usually configured, this property can specify the following things:

- The start date of product offering effective dates,

- The start date of product offering availability dates, and

- The start date of schedule effective dates.

The function of a specific instance of this property is determined by the StartDateType property.

### Visual Basic Syntax

Property StartDate As DATE

### C++ Syntax

HRESULT StartDate([out, retval] DATE *pVal);

HRESULT StartDate([in] DATE newVal);

## StartOffset

Only for SUBSCRIPTION_RELATIVE start date type: this property specifies the number of days after start of subscription.

### Visual Basic Syntax

Property StartOffset As Long

### C++ Syntax

HRESULT StartOffset([out, retval] long *pVal);

HRESULT StartOffset([in] long newVal);

## EndDateType

This property uses the MTPCDateType enum type to specify the type of end date.

Note that if a date is not set, its DateType is PCDATE_TYPE_NO_DATE (=0)

If a date means infinite start or end, its DateType is PCDATE_TYPE_NULL (=4)

### Visual Basic Syntax

Property EndDateType As MTPCDateType

### C++ Syntax

HRESULT EndDateType([out, retval] MTPCDateType *pVal);

HRESULT EndDateType([in] MTPCDateType newVal);

## EndDate

As the MT Platform is usually configured, this property can specify the following things:

- The end date of product offering effective dates,

- The end date of product offering availability dates, and

- The end date of rate schedule effective dates.

The function of a specific instance of this property is determined by the EndDateType property.

### Visual Basic Syntax

Property EndDate As DATE

### C++ Syntax

HRESULT EndDate([out, retval] DATE *pVal);

HRESULT EndDate([in] DATE newVal);

## EndOffset

Only for SUBSCRIPTION_RELATIVE end date type: this property specifies the number of days after start subscription.

### Visual Basic Syntax

Property EndOffset As Long

### C++ Syntax

HRESULT EndOffset([out, retval] long *pVal);

HRESULT EndOffset([in] long newVal);

##