Partilhar via


COMVariant.createFromDate Method

Definition

Overloads

createFromDate(Date)

Creates a new COMVariant object and initializes it with a date value in one operation.

createFromDate(Date, COMVariantInOut)

createFromDate(Date)

Creates a new COMVariant object and initializes it with a date value in one operation.

public:
 static Dynamics::AX::Application::COMVariant ^ createFromDate(Microsoft::Dynamics::Ax::Xpp::AxShared::Date date1);
public static Dynamics.AX.Application.COMVariant createFromDate (Microsoft.Dynamics.Ax.Xpp.AxShared.Date date1);
static member createFromDate : Microsoft.Dynamics.Ax.Xpp.AxShared.Date -> Dynamics.AX.Application.COMVariant
Public Shared Function createFromDate (date1 As Date) As COMVariant

Parameters

date1
Microsoft.Dynamics.Ax.Xpp.AxShared.Date

Returns

The new COMVariant object.

Remarks

The COMVariant object that is created by this method has the data type VT_DATE (date/time). You can change the data type of an existing COMVariant object to VT_DATE by using the variantType method or by passing in a time value by using the date property method. If you want to use a date that is outside the range for the Axapta date type (0111901 to 31122154), use the COMVariant.createDateFromYMD method.

The following example creates a COMVariant object and initializes it with the current date.

COMVariant theDay; 
theDay = COMVariant::createFromDate(today()); 
info(theDay.toString());

Applies to

createFromDate(Date, COMVariantInOut)

public:
 static Dynamics::AX::Application::COMVariant ^ createFromDate(Microsoft::Dynamics::Ax::Xpp::AxShared::Date _value, Dynamics::AX::Application::COMVariantInOut _inOutFlag);
public static Dynamics.AX.Application.COMVariant createFromDate (Microsoft.Dynamics.Ax.Xpp.AxShared.Date _value, Dynamics.AX.Application.COMVariantInOut _inOutFlag);
static member createFromDate : Microsoft.Dynamics.Ax.Xpp.AxShared.Date * Dynamics.AX.Application.COMVariantInOut -> Dynamics.AX.Application.COMVariant
Public Shared Function createFromDate (_value As Date, _inOutFlag As COMVariantInOut) As COMVariant

Parameters

_value
Microsoft.Dynamics.Ax.Xpp.AxShared.Date

A flag that determines whether the object can be used to pass data to a COM method or COM property, to receive data, or both. This parameter is optional. Possible values are:

_inOutFlag
COMVariantInOut

A flag that determines whether the object can be used to pass data to a COM method or COM property, to receive data, or both. This parameter is optional. Possible values are:

Returns

Applies to