Share via


COMVariant::createFromDateAndTime Method

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

Syntax

client server public static COMVariant createFromDateAndTime(
    date date, 
    int time, 
   [COMVariantInOut inOutFlag])

Run On

Called

Parameters

  • date
    Type: date
    The date value that is used to initialize the object.
  • time
    Type: int
    The time value, expressed as the number of seconds since midnight, that is used to initialize the object.
  • inOutFlag
    Type: COMVariantInOut Enumeration
    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:

Return Value

Type: COMVariant Class
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.

Examples

The following example creates a COMVariant object and assigns it the current date, and a time of 10 seconds past midnight.

date theDay; 
COMVariant theDayAndTime; 
 
theDay = today(); 
theDayAndTime = COMVariant::createFromDateAndTime(theDay, 10); 
info(theDayAndTime.toString());

See Also

COMVariant Class

COMVariant::createFromDate Method

COMVariant::createFromTime Method

COMVariant.date Method

COMVariant.time Method

COMVariant.variantType Method