Return Values for the CStr Function (Visual Basic)
Updated: July 20, 2015
For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.
The following table describes the return values for
CStr for different data types of
|Boolean Data Type||A string containing "True" or "False".|
|Date Data Type||A string containing a |
|Numeric Data Types||A string representing the number.|
Date type always contains both date and time information. For purposes of type conversion, Visual Basic considers 1/1/0001 (January 1 of the year 1) to be a neutral value for the date, and 00:00:00 (midnight) to be a neutral value for the time.
CStr does not include neutral values in the resulting string. For example, if you convert
#January 1, 0001 9:30:00# to a string, the result is "9:30:00 AM"; the date information is suppressed. However, the date information is still present in the original
Date value and can be recovered with functions such as DatePart.