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

For an example of how to use this command, please see the Example below.

Syntax date command

 date [/t | ] 

Parameters

The Description parameter is set, in which Month is the month (one or two digits), Day is the date (one or two digits) and Year is the year (two or four digits). / t Display the current date without prompting the user to enter a new date. /? Show help at the command prompt.

Note

  1. To change the current date, you must have admin login information.
  2. You must separate the values ​​for Month , Day and Year by dots (.), Hyphens (-) or slashes (/).
  3. Valid Month values ​​are from 1 to 12.
  4. Valid Day value is from 1 to 31.
  5. Valid Year values ​​are from 00 to 99 or 1980 to 2099. If you use two digits, the values ​​from 80 to 99 correspond to the years 1980 to 1999.

For example

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

 date /t 

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

 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, enter:

 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, enter the new date and then press ENTER.

See more:

  1. Cscript command in Windows
  2. Compact command in Windows
  3. The dfsrmig command in Windows

 

4.5 ★ | 2 Vote | 👨 708 Views

Above is an article about: "The date command in Windows". Hope this article is useful to you. Don't forget to rate the article, like and share this article with your friends and relatives. Good luck!

« PREV POST
NEXT POST »