Assembly: Microsoft.VisualBasic (in microsoft.visualbasic.dll)
Required. String expression representing a date/time value from 00:00:00 on January 1 of the year 1 through 23:59:59 on December 31, 9999.
Return ValueReturns a Date value containing the date information represented by a string, with the time information set to midnight (00:00:00).
For more detailed information, see the Visual Basic topic DateValue Function (Visual Basic).
If StringDate includes only numbers from 1 through 12 separated by valid date separators, DateValue recognizes the order for month, day, and year according to the Short Date format specified for your system. DateValue uses the current calendar setting from the CurrentCulture property of the CultureInfo class in the System.Globalization namespace. The default CurrentCulture values are determined by Control Panel settings. You can override the Short Date format by setting the ShortDatePattern property of the DateTimeFormatInfo class in the System.Globalization namespace.
DateValue recognizes month names in long, abbreviated, and numeric form. For example, in addition to recognizing 12/30/1991 and 12/30/91, DateValue also recognizes December 30, 1991 and Dec 30, 1991.
If the year part of StringDate is omitted, DateValue uses the current year from your computer's system date.
If the StringDate argument includes time information, DateValue does not include it in the returned value. However, if StringDate includes invalid time information, such as "89:98", an InvalidCastException error occurs.
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
Other ResourcesDateValue Function (Visual Basic)
DateSerial Function (Visual Basic)
Day Function (Visual Basic)
Month Function (Visual Basic)
TimeSerial Function (Visual Basic)
TimeValue Function (Visual Basic)
Weekday Function (Visual Basic)
Year Function (Visual Basic)
Date Data Type (Visual Basic)