Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: DateTime


Message #1 by <herbe@a...> on Tue, 26 Mar 2002 13:41:37 -0500
Assuming that your string is in a normal date format (12/24/2002 5:01:02
PM), you can do:

dim myDate as date
dim myString as string

mystring = "12/24/2002 5:01:02 PM"
myDate = myString

If you need something more explicit:
CDate(expression)
Return Types

The function name determines the return type as shown in the following:

      Function Return Type Range for expression argument
      CBool Boolean Any valid string or numeric expression.
      CByte Byte  0 to 255.
      CCur Currency  -922,337,203,685,477.5808 to 922,337,203,685,477.5807.
      CDate Date  Any valid date expression.


date expression
Any expression that can be interpreted as a date, including date literals,
numbers that look like dates, strings that look like dates, and dates
returned from functions. A date expression is limited to numbers or strings,
in any combination, that can represent a date from January 1, 100 - December
31, 9999.

Dates are stored as part of a real number. Values to the left of the decimal
represent the date; values to the right of the decimal represent the time.
Negative numbers represent dates prior to December 30, 1899.


----- Original Message -----
From: <herbe@a...>
To: "professional vb" <pro_vb@p...>
Sent: Tuesday, March 26, 2002 10:41 AM
Subject: [pro_vb] DateTime


>      For some reason I forgot how to convert a string to a DateTime
>
>      Could anyone help me out with this
>
>      Thanks
>
>
>
>
>
>

  Return to Index