Share via


DataFunctions.ConvertDateTimeString Method (PIA)

Use this method to convert a date and time string to a date/time object, based on the default or specified locale.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop
…
Public Function ConvertDateTimeString(vtDateTime As Object,
 Optional vtLocale As Object) As Object

[C#]

using Microsoft.CommerceServer.Interop;
…
public object ConvertDateTimeString(objectvtDateTime,
  objectvtLocale);

Parameters

[Visual Basic .NET]

  • vtDateTime
    An Object that contains a string that specifies the date/time value to convert.
  • vtLocale
    An Object that specifies the locale to use to convert the date. If this value is not specified, the value of the Locale property of the DataFunctions object is used.

[C#]

  • vtDateTime
    An object that contains a string that specifies the date/time value to convert.
  • vtLocale
    An object that specifies the locale to use to convert the date. 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 datetime Object that contains the converted date/time value; otherwise, Null is returned.

[C#] This method returns an object containing the converted date/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]

' Converts date time string using US and France locales
' oSourceDateTime is an Object containing a date time string
Dim Result As Object
DataFunctions df = New DataFunctions()
df.Locale = 1036
Result = df.ConvertDateTimeString(oSourceDateTime)
Response.Write("France: " & Result & "<P>")
df.Locale = 1033
Result = df.ConvertDateTimeString(oSourceDateTime)
Response.Write("USA: " & Result)

[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.ConvertDateString

DataFunctions.Date

DataFunctions.DateTime

Page.RequestTime

Copyright © 2005 Microsoft Corporation.
All rights reserved.