Share via


DataFunctions.Time Method (PIA)

Use this method to converts a System.DateTime to a string representation of the time.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop
…
Public Function Time(dtDate As Date,
 vtLocale As Object) As Object

[C#]

using Microsoft.CommerceServer.Interop;
…
public object Time(System.DateTimedtDate,
 objectvtLocale);

Parameters

[Visual Basic .NET]

  • dtDate
    A Date type that contains the time value to convert.
  • vtLocale
    An Object that specifies the locale to use to convert the time value to a string. If this parameter is not specified, the value of the Locale property of the DataFunctions object is used.

[C#]

  • dtDate
    A System.DateTime type that contains the time value to convert.
  • vtLocale
    An object that specifies the locale to use to convert the time value to a string. If you want the value of the Locale property of the DataFunctions object to be used, pass Type.Missing for this parameter.

Return Values

[Visual Basic .NET] If this method completes successfully, it returns a string Object that contains the string representation of the specified time value; otherwise, Null is returned.

[C#] This method returns an object containing the string representation of the specified time value.

Exceptions

This method may throw one of many mapped exceptions or an exception of type COMException. See Standard COM Errors for additional details.

Example

[Visual Basic .NET]

' oResult is an Object, dDate is a Date
DataFunctions df = New DataFunctions()
' Set Locale to USA
myLocale = 1033
df.Locale = myLocale
oResult = df.Time(dDate, myLocale)
Response.Write("USA: " & Result & "<P>")

[C#]

No example available.

Requirements

Namespace: Microsoft.CommerceServer.Interop

Platforms: Windows 2000, Windows Server 2003

Assembly: mscsasphelplib (in mscsasphelplib.dll)

See Also

DataFunctions Class

DataFunctions.Locale

DataFunctions.ConvertTimeString

Copyright © 2005 Microsoft Corporation.
All rights reserved.