Date


Applies To: Windows Server 2008,Windows Vista

Displays or sets the system date. If used without parameters, date displays the current system date setting and prompts you to enter a new date.

For examples of how to use this command, see Examples.

Syntax


Copy Code

date [/t | <Month-Day-Year>]

Parameters

Parameter

Description

<Month-Day-Year>

Sets the date specified, where Month is the month (one or two digits), Day is the day (one or two digits), and Year is the year (two or four digits).

/t

Displays the current date without prompting you for a new date.

/?

Displays help at the command prompt.

Remarks

Examples

If command extensions are enabled, to display the current system date, type:


Copy Code

date /t

To change the current system date to August 3, 2007, you can type any of the following:


Copy Code

date 08.03.2007
date 08-03-07
date 8/3/07

To display the current system date, followed by a prompt to enter a new date, type:


Copy Code

The current date is: Mon 04/02/2007
Enter the new date: (mm-dd-yy)

To keep the current date and return to the command prompt, press ENTER. To change the current date, type the new date and then press ENTER.

Additional references

Command-Line Syntax Key