Export (0) Print
Expand All

DateAndTime.Today Property

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

Namespace: Microsoft.VisualBasic
Assembly: Microsoft.VisualBasic (in microsoft.visualbasic.dll)

public static DateTime Today { get; set; }
/** @property */
public static DateTime get_Today ()

/** @property */
public static void set_Today (DateTime Value)

public static function get Today () : DateTime

public static function set Today (Value : DateTime)

Not applicable.

Property Value

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

For more detailed information, see the Visual Basic topic Today Property.

The Date data type includes time components. When returning the system date, Today sets all of these to 0, so the returned value represents midnight (00:00:00). When setting the system date, Today ignores the time components.

To access the current system date as a String, use the DateString Property.

To get or set the current system time, use the TimeOfDay Property.

Security noteSecurity Note:

Setting the system date or time requires unmanaged code permission, which might affect its execution in partial-trust situations. For more information, see SecurityPermission and Code Access Permissions.

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

Dim thisDate As Date
thisDate = Today

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft