DateAndTime DateAndTime DateAndTime DateAndTime Class

Definition

The DateAndTime module contains the procedures and properties used in date and time operations.

public ref class DateAndTime sealed
[Microsoft.VisualBasic.CompilerServices.StandardModule]
public sealed class DateAndTime
type DateAndTime = class
Public Module DateAndTime
Inheritance
DateAndTimeDateAndTimeDateAndTimeDateAndTime
Attributes

Examples

This example uses the Today property to return the current system date.

Dim thisDate As Date  
thisDate = Today   

Remarks

This module supports the Visual Basic language keywords and run-time library members that get the current date or time, perform date calculations, return a date or time, set the date or time, or time the duration of a process.

Properties

DateString DateString DateString DateString

Returns or sets a string value representing the current date according to your system.

Now Now Now Now

Returns a value containing the current date and time according to your system.

TimeOfDay TimeOfDay TimeOfDay TimeOfDay

Returns or sets a Date value containing the current time of day according to your system.

Timer Timer Timer Timer

Returns a Double value representing the number of seconds elapsed since midnight.

TimeString TimeString TimeString TimeString

Returns or sets a string value representing the current time of day according to your system.

Today Today Today Today

Returns or sets a Date value containing the current date according to your system.

Methods

DateAdd(DateInterval, Double, DateTime) DateAdd(DateInterval, Double, DateTime) DateAdd(DateInterval, Double, DateTime) DateAdd(DateInterval, Double, DateTime)

Returns a value containing a date and time value to which a specified time interval has been added.

DateAdd(String, Double, Object) DateAdd(String, Double, Object) DateAdd(String, Double, Object) DateAdd(String, Double, Object)

Returns a value containing a date and time value to which a specified time interval has been added.

DateDiff(DateInterval, DateTime, DateTime, FirstDayOfWeek, FirstWeekOfYear) DateDiff(DateInterval, DateTime, DateTime, FirstDayOfWeek, FirstWeekOfYear) DateDiff(DateInterval, DateTime, DateTime, FirstDayOfWeek, FirstWeekOfYear) DateDiff(DateInterval, DateTime, DateTime, FirstDayOfWeek, FirstWeekOfYear)

Returns a long value specifying the number of time intervals between two Date values.

DateDiff(String, Object, Object, FirstDayOfWeek, FirstWeekOfYear) DateDiff(String, Object, Object, FirstDayOfWeek, FirstWeekOfYear) DateDiff(String, Object, Object, FirstDayOfWeek, FirstWeekOfYear) DateDiff(String, Object, Object, FirstDayOfWeek, FirstWeekOfYear)

Returns a long value specifying the number of time intervals between two Date values.

DatePart(DateInterval, DateTime, FirstDayOfWeek, FirstWeekOfYear) DatePart(DateInterval, DateTime, FirstDayOfWeek, FirstWeekOfYear) DatePart(DateInterval, DateTime, FirstDayOfWeek, FirstWeekOfYear) DatePart(DateInterval, DateTime, FirstDayOfWeek, FirstWeekOfYear)

Returns an integer value containing the specified component of a given Date value.

DatePart(String, Object, FirstDayOfWeek, FirstWeekOfYear) DatePart(String, Object, FirstDayOfWeek, FirstWeekOfYear) DatePart(String, Object, FirstDayOfWeek, FirstWeekOfYear) DatePart(String, Object, FirstDayOfWeek, FirstWeekOfYear)

Returns an value containing the specified component of a given Date value.

DateSerial(Int32, Int32, Int32) DateSerial(Int32, Int32, Int32) DateSerial(Int32, Int32, Int32) DateSerial(Int32, Int32, Int32)

Returns a Date value representing a specified year, month, and day, with the time information set to midnight (00:00:00).

DateValue(String) DateValue(String) DateValue(String) DateValue(String)

Returns a Date value containing the date information represented by a string, with the time information set to midnight (00:00:00).

Day(DateTime) Day(DateTime) Day(DateTime) Day(DateTime)

Returns an integer value from 1 through 31 representing the day of the month.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
Hour(DateTime) Hour(DateTime) Hour(DateTime) Hour(DateTime)

Returns an integer value from 0 through 23 representing the hour of the day.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
Minute(DateTime) Minute(DateTime) Minute(DateTime) Minute(DateTime)

Returns an integer value from 0 through 59 representing the minute of the hour.

Month(DateTime) Month(DateTime) Month(DateTime) Month(DateTime)

Returns an integer value from 1 through 12 representing the month of the year.

MonthName(Int32, Boolean) MonthName(Int32, Boolean) MonthName(Int32, Boolean) MonthName(Int32, Boolean)

Returns a string value containing the name of the specified month.

Second(DateTime) Second(DateTime) Second(DateTime) Second(DateTime)

Returns an integer value from 0 through 59 representing the second of the minute.

TimeSerial(Int32, Int32, Int32) TimeSerial(Int32, Int32, Int32) TimeSerial(Int32, Int32, Int32) TimeSerial(Int32, Int32, Int32)

Returns a Date value representing a specified hour, minute, and second, with the date information set relative to January 1 of the year 1.

TimeValue(String) TimeValue(String) TimeValue(String) TimeValue(String)

Returns a Date value containing the time information represented by a string, with the date information set to January 1 of the year 1.

ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)
Weekday(DateTime, FirstDayOfWeek) Weekday(DateTime, FirstDayOfWeek) Weekday(DateTime, FirstDayOfWeek) Weekday(DateTime, FirstDayOfWeek)

Returns an integer value containing a number representing the day of the week.

WeekdayName(Int32, Boolean, FirstDayOfWeek) WeekdayName(Int32, Boolean, FirstDayOfWeek) WeekdayName(Int32, Boolean, FirstDayOfWeek) WeekdayName(Int32, Boolean, FirstDayOfWeek)

Returns a string value containing the name of the specified weekday.

Year(DateTime) Year(DateTime) Year(DateTime) Year(DateTime)

Returns an integer value from 1 through 9999 representing the year.

Applies to

See also