An Introduction to the .NET FCL, Part 5
Pages: 1, 2, 3, 4
DateTime Structure
The Visual Basic Date data type corresponds to the .NET Framework's DateTime structure. The following table lists the DateTime members whose functionality is not available in the date/time functions supported by the VB.NET language:
|
Name |
Member type |
Description |
|---|---|---|
|
AddMilliseconds |
Method |
Adds a designated number of milliseconds to the DateTime instance |
|
AddTicks |
Method |
Adds a designated number of ticks to the DateTime instance |
|
CompareTo |
Method |
Compares the current DateTime instance to an object and returns an indication of their relative values |
|
DaysInMonth |
Shared method |
Returns the number of days in a designated month and year |
|
FromOADate |
Shared method |
Converts an OLE Automation Date value to a DateTime instance |
|
GetDateTimeFormats |
Method |
Returns a String array containing all the string representations supported by the standard DateTime format specifiers |
|
IsLeapYear |
Shared method |
Returns a Boolean indicating whether a particular year is a leap year |
|
MaxValue |
Shared field |
A constant containing the largest possible value of a DateTime instance |
|
Millisecond |
Property |
Retrieves the milliseconds component of a DateTime instance |
|
MinValue |
Shared field |
A constant containing the smallest possible value of a DateTime instance |
|
Now |
Shared property |
Returns the current local date and time |
|
Parse |
Shared method |
Converts a string representation of a date/time to a DateTime instance |
|
ParseExact |
Shared method |
Converts a string representation of a date/time in a specified format to its DateTime equivalent |
|
Ticks |
Property |
Returns a Long containing the number of ticks that represent the date and time value of this instance |
|
TimeOfDay |
Property |
Returns the current time of day |
|
Today |
Shared property |
Returns the current date |
|
ToFileTime |
Method |
Converts the DateTime instance to the format of the local system's file time |
|
ToLocalTime |
Method |
Converts the current coordinated universal time (UTC) to local time |
|
ToLongDateString |
Method |
Converts a DateTime instance to its long date string representation |
|
ToLongTimeString |
Method |
Converts a DateTime instance to its long time string representation |
|
ToOADate |
Method |
Converts the value of this instance to a Double representing the OLE Automation date |
|
ToShortDateString |
Method |
Converts a DateTime instance to its short date string representation |
|
ToShortTimeString |
Method |
Converts a DateTime instance to its short time string representation |
|
ToUniversalTime |
Method |
Converts the value of the DateTime instance to coordinated universal time (UTC) |
|
UtcNow |
Shared property |
Returns a DateTime instance that represents the current local date and time expressed as the coordinated universal time (UTC) |
Decimal Structure
The VB.NET Decimal data type corresponds directly to the System.Decimal structure. The CTS Decimal structure includes the following members whose functionality is not readily available in VB.NET:
|
Name |
Member type |
Description |
|---|---|---|
|
FromOACurrency |
Shared method |
Converts a Long containing an OLE Automation Currency value (e.g., a VB6 or VBScript Currency value) to a Decimal value |
|
GetBits |
Shared method |
Converts a particular Decimal value to its binary representation and returns that value as an Integer |
|
MaxValue |
Shared field |
A constant containing the largest possible value of a Decimal object |
|
MinValue |
Shared field |
A constant containing the smallest possible value of a Decimal object |
|
ToOACurrency |
Shared method |
Converts a Decimal value to an OLE Automation Currency value (e.g., a VB6 or VBScript Currency value), which it returns as a Long |
Double Structure
The VB.NET Double data type corresponds to the .NET Framework's System.Double data type. The following table lists the members of the latter that offer functionality not found in the Visual Basic .NET language:
|
Name |
Member type |
Description |
|---|---|---|
|
Epsilon |
Shared field |
A constant containing the smallest positive Double value greater than zero |
|
MaxValue |
Shared field |
A constant containing the largest possible value of a Double object |
|
MinValue |
Shared field |
A constant containing the smallest possible value of a Double object |
|
NaN |
Shared field |
A constant containing the representation of a value that is not a number (NaN) |
|
NegativeInfinity |
Shared field |
A constant containing a number that represents negative infinity |
|
PositiveInfinity |
Shared field |
A constant containing a number that represents positive infinity |
|
IsInfinity |
Shared method |
Returns a Boolean indicating whether the value of a Double object represents positive or negative infinity |
|
InNaN |
Shared method |
Returns a Boolean indicating whether a Double object contains a value that is not a number (NaN) |
|
IsNegativeInfinity |
Shared method |
Returns a Boolean indicating whether the value of a Double object represents negative infinity |
|
IsPositiveInfinity |
Shared method |
Returns a Boolean indicating whether the value of a Double object represents positive infinity |
|
Parse |
Shared method |
Converts the string representation of a number to its Double equivalent |

