DataFunctions.ValidateDateTime

Ee810927.c++_on(en-US,CS.10).gifEe810927.vb_off(en-US,CS.10).gif

Use this method to check whether a string contains a valid date, time, or date and time, and optionally to check against a specified range.

Definition

Function ValidateDateTime(vtDate As Variant,vtMin As Variant,vtMax As Variant) As Variant

Parameters

vtDate

A Variant that contains the value to validate. This value can be a date, a time, or both.

vtMin

A Variant that contains a value specifying the low end of the range. The default value for this parameter is NULL, which means that the vtMin parameter is ignored in the range validation.

vtMax

A Variant that contains a value specifying the high end of the range. The default value for this parameter is NULL, which means that the vtMax parameter is ignored in the range validation.

Return Values

If this method completes successfully, it returns a Boolean Variant indicating whether the vtDate parameter is valid. A value of True indicates the vtDate parameter is a valid date, time, or date/time, and that it is within the given range, if any.

Error Values

This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to standard COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.

Remarks

For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.

Example

' vResult is a Variant, vSourceDate is a Variant containing
' a string representation of a date or date and time
Set MSCSDataFunctions = Server.CreateObject("Commerce.DataFunctions")
vResult = MSCSDataFunctions.ValidateDateTime(vSourceDate,"1/1/1900", _
    "12/31/2525")

See Also

DataFunctions Object

DataFunctions.Date

DataFunctions.DateTime

DataFunctions.Time

DataFunctions.ConvertDateString

DataFunctions.ConvertDateTimeString

DataFunctions.ConvertTimeString


All rights reserved.