Skip to content

Latest commit

 

History

History
41 lines (25 loc) · 1.1 KB

date-function.md

File metadata and controls

41 lines (25 loc) · 1.1 KB
title keywords f1_keywords ms.assetid ms.date ms.localizationpriority
Date function (Visual Basic for Applications)
vblr6.chm1008886
vblr6.chm1008886
8afd02c8-c5b5-f8f3-ff8e-9a2ac0ea94b9
12/12/2018
medium

Date function

Returns a Variant (Date) containing the current system date.

Syntax

Date

Remarks

To set the system date, use the Date statement.

Date, and if the calendar is Gregorian, Date$ behavior is unchanged by the Calendar property setting. If the calendar is Hijri, Date$ returns a 10-character string of the form mm-dd-yyyy, where mm (01–12), dd (01–30) and yyyy (1400–1523) are the Hijri month, day, and year. The equivalent Gregorian range is Jan 1, 1980, through Dec 31, 2099.

Example

This example uses the Date function to return the current system date.

Dim MyDate
MyDate = Date    ' MyDate contains the current system date.

See also

[!includeSupport and feedback]