VB.NET’s DateTime anatomy represents an burning in time and is usually bidding as a accurate date and time of the day. DateTime comes in accessible whenever you charge to actuate the system’s date and time; it aswell performs assorted operations on date/time variables. In this article, I appearance how to advance DateTime backdrop and methods so you can plan with DateTime ethics in VB.NET.
Here are listings of the a lot of frequently acclimated backdrop and methods of the DateTime structure.
Properties:
-
Date: allotment the date basic of the DateTime value.
-
Day: allotment the day of the ages basic of the DateTime value.
-
DayOfWeek: allotment the day of the anniversary basic of the DateTime value.
-
DayOfYear: allotment the day of the year basic of the DateTime value.
-
Hour: allotment the hour basic of the DateTime value.
-
Millisecond: allotment the milliseconds basic of the DateTime value.
-
Minute: allotment the minute basic of the DateTime value.
-
Month: allotment the ages basic of the DateTime value.
-
Now: allotment a DateTime amount that is the accepted bounded date and time on this computer.
-
Second: allotment the abnormal basic of the DateTime value.
-
TimeOfDay: allotment the time of day of the DateTime value.
-
Today: allotment the accepted arrangement date.
-
UtcNow: allotment a DateTime amount that is the accepted bounded date and time on this computer bidding as the Coordinated Universal Time (UTC).
-
Year: allotment the year basic of the DateTime value.
Methods :
-
Add: adds the amount of the defined TimeSpan to the DateTime value.
-
AddDays: adds the defined amount of canicule to the DateTime value.
-
AddHours: adds the defined amount of hours to the DateTime value.
-
AddMilliseconds: adds the defined amount of milliseconds to the DateTime value.
-
AddMinutes: adds the defined amount of account to the DateTime value.
-
AddMonths: adds the defined amount of months to the DateTime value.
-
AddSeconds: adds the defined amount of abnormal to the DateTime value.
-
AddYears: adds the defined amount of years to the DateTime value.
-
DaysInMonth: allotment the amount of canicule in the defined ages of the defined year.
-
IsLeapYear: allotment an adumbration of whether the defined year is a bound year.
-
Subtract: subtracts the defined time or continuance from the DateTime value.
-
ToLocalTime: converts the accepted Coordinated Universal Time (UTC) to bounded time.
-
ToLongDateString: converts the amount of this instance to its agnate continued date cord representation.
-
ToLongTimeString: converts the amount of this instance to its agnate continued time cord representation.
-
ToShortDateString: converts the amount of this instance to its agnate abbreviate date cord representation.
-
ToShortTimeString: converts the amount of this instance to its agnate abbreviate time cord representation.
-
ToUniversalTime: converts the accepted bounded time to Coordinated Universal Time (UTC).

The new My objects provide easy access to various features that developers often need but don’t necessarily know where to find in the sprawling .NET class library. Essentially, the My objects offer one-stop shopping, with access to everything from the Windows registry to the current network connection. Best of all, the My object hierarchy is organized according to use and is easy to navigate using Visual Studio IntelliSense.





