DATE & TIME FUNCTIONSASHISH  S.  RAHURKAR
Microsoft.VisualBasic.DateAndTime NamespaceDateAddDateDiffDatePartDateStringDateValueNowSecondTimeOfDayTimeStringTimeValueTodayWeekDayWeekDayName
CONTROLS USEDButtonLabelDateTimePicker
CONTROL PROPERTIESBUTTONLABELNameTextNameTextFont
CONTROL PROPERTIES (CONTINUED)DateTimePickerNameValue
DateAddReturns date value to which a time interval has been added.Arguments:-Interval – DateInterval enumeration val (str)Number – (+,-) Double valueDateValue - date
DateDiffReturns Long value representing the time interval between two datesArguments:-IntervalDate1,Date2DayOfWeek – Optional, FirstDayOfWeek enumeration, default SundayWeekOfYear – Optional, FirstWeekOfYear enumeration, default Jan1
DatePartReturns an integer value representing the requested part of a date.Arguments:-IntervalDateValueDayOfWeekWeekOfYear
DateStringIt’s a propertyReturns or sets a string value representing the current date on your system
DateValueReturns a Date data type value containing the date represented by a string.Arguments:-DateString – (eg – January 15, 1994)
NowIt’s a property.Returns a date value containing the current date & time of your system
SecondReturns an integer value representing second of the minute of the date passedArgument:-TimeValue
TimeOfDayIt’s a propertyReturns time value containing the current date & time of your systemWhere date value is set to all 1’s
TimeStringIt’s a propertyReturns or sets a string value representing the current time of day according to your system
TimeValueReturns a date value representing the time of a string passedHere date value is set to all 1’sArguments:-TimeString – range from 1/1/1 00:00:00 to 12/31/9999 23:59:59
TodayIt’s a propertyReturns or sets a date value containing the current date according to your system
WeekDayReturns an integer value containing a number representing the day of the weekArguments:-DateValueDayOfWeek
WeekDayNameReturns a string value containing the name of the specified weekdayArguments:-WeekDay – 1 to 7Abbreviate – Optional boolean valueFirstDayOfWeekValue – FirstDayOfWeek.System is default

Date & time functions in VB.NET

Editor's Notes

  • #7 DateInterval – day,year,month etc.
  • #8 DayOfWeek – system, Sunday, Monday, Tuesday…WeekOfYear – system, jan1, firstfourdays