VB.Net

Archive for the VB.NET Category

Posted in Coding, VB.NET on 18 November 2008 by harisanto

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:

1.
Date: allotment the date basic of the DateTime value.
2.
Day: allotment the day of the ages basic of the DateTime value.
3.
DayOfWeek: allotment the day of the anniversary basic of the DateTime value.
4.
DayOfYear: allotment the day of the year basic of the DateTime value.
5.
Hour: allotment the hour basic of the DateTime value.
6.
Millisecond: allotment the milliseconds basic of the DateTime value.
7.
Minute: allotment the minute basic of the DateTime value.
8.
Month: allotment the ages basic of the DateTime value.
9.
Now: allotment a DateTime amount that is the accepted bounded date and time on this computer.
10.
Second: allotment the abnormal basic of the DateTime value.
11.
TimeOfDay: allotment the time of day of the DateTime value.
12.
Today: allotment the accepted arrangement date.
13.
UtcNow: allotment a DateTime amount that is the accepted bounded date and time on this computer bidding as the Coordinated Universal Time (UTC).
14.
Year: allotment the year basic of the DateTime value.

Methods :

1.
Add: adds the amount of the defined TimeSpan to the DateTime value.
2.
AddDays: adds the defined amount of canicule to the DateTime value.
3.
AddHours: adds the defined amount of hours to the DateTime value.
4.
AddMilliseconds: adds the defined amount of milliseconds to the DateTime value.
5.
AddMinutes: adds the defined amount of account to the DateTime value.
6.
AddMonths: adds the defined amount of months to the DateTime value.
7.
AddSeconds: adds the defined amount of abnormal to the DateTime value.
8.
AddYears: adds the defined amount of years to the DateTime value.
9.
DaysInMonth: allotment the amount of canicule in the defined ages of the defined year.
10.
IsLeapYear: allotment an adumbration of whether the defined year is a bound year.
11.
Subtract: subtracts the defined time or continuance from the DateTime value.
12.
ToLocalTime: converts the accepted Coordinated Universal Time (UTC) to bounded time.
13.
ToLongDateString: converts the amount of this instance to its agnate continued date cord representation.
14.
ToLongTimeString: converts the amount of this instance to its agnate continued time cord representation.
15.
ToShortDateString: converts the amount of this instance to its agnate abbreviate date cord representation.
16.
ToShortTimeString: converts the amount of this instance to its agnate abbreviate time cord representation.
17.
ToUniversalTime: converts the accepted bounded time to Coordinated Universal Time (UTC).