VB.Net with Dates and Times
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).
6 February 2009 at 10:37 am
mampir aja :D