Time and date
Encyclopedia
In computing
,
that are used to display and set the current time and date
of the operating system
. Both commands are available in DOS
, OS/2
and Microsoft Windows
command line interpreters (shells
) such as
/4NT
. The Unix
command
privileges may use
,
Note: When these commands are called from the command line or a batch script, they will display the time or date and wait for the user to type a new time or date and press RETURN. The parameter '/t' will bypass asking the user to reset the time or date.
The format of the date parameter is dependent upon regional settings.
Note:
Computing
Computing is usually defined as the activity of using and improving computer hardware and software. It is the computer-specific part of information technology...
,
time
and date
are commandsCommand (computing)
In computing, a command is a directive to a computer program acting as an interpreter of some kind, in order to perform a specific task. Most commonly a command is a directive to some kind of command line interface, such as a shell....
that are used to display and set the current time and date
Calendar date
A date in a calendar is a reference to a particular day represented within a calendar system. The calendar date allows the specific day to be identified. The number of days between two dates may be calculated. For example, "24 " is ten days after "14 " in the Gregorian calendar. The date of a...
of the operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...
. Both commands are available in DOS
DOS
DOS, short for "Disk Operating System", is an acronym for several closely related operating systems that dominated the IBM PC compatible market between 1981 and 1995, or until about 2000 if one includes the partially DOS-based Microsoft Windows versions 95, 98, and Millennium Edition.Related...
, OS/2
OS/2
OS/2 is a computer operating system, initially created by Microsoft and IBM, then later developed by IBM exclusively. The name stands for "Operating System/2," because it was introduced as part of the same generation change release as IBM's "Personal System/2 " line of second-generation personal...
and Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...
command line interpreters (shells
Shell (computing)
A shell is a piece of software that provides an interface for users of an operating system which provides access to the services of a kernel. However, the term is also applied very loosely to applications and may include any software that is "built around" a particular component, such as web...
) such as
COMMAND.COMCOMMAND.COMCOMMAND.COM is the filename of the default operating system shell for DOS operating systems and the default command line interpreter on Windows 95, Windows 98 and Windows Me...
, cmd.exeCmd.exeCommand Prompt is the Microsoft-supplied command-line interpreter on OS/2, Windows CE and on Windows NT-based operating systems...
and 4DOS4DOS
4DOS is a command line interpreter by JP Software, designed to replace the default command interpreter COMMAND.COM in DOS and Windows 95/98/Me. The 4DOS family of programs are meant to replace the default command processor. 4OS2 and 4NT replace CMD.EXE in OS/2 and Windows NT respectively...
/4NT
4NT
Take Command Console , formerly known as 4DOS for Windows NT and 4NT, is a command line interpreter by JP Software, designed as a substitute for the default command interpreter in Microsoft Windows...
. The Unix
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...
command
dateDate (Unix)The Unix date command displays the time and date. The super-user can use it to set the system clock.- Usage :With no options, the date command displays the current date and time, including the abbreviated day name, abbreviated month name, day of the month, the time separated by colons, the timezone...
displays both the time and date, but does not allow the normal users to change either. Users with superuserSuperuser
On many computer operating systems, the superuser is a special user account used for system administration. Depending on the operating system, the actual name of this account might be: root, administrator or supervisor....
privileges may use
date -s
to change the time and date. The Unix command timeTime (Unix)time is a command in the Unix operating systems. It is used to determine the duration of execution of a particular command.-Usage:To use the command, simply precede any command by the word time, such as:time ls...
performs a different function. In Windows PowerShellWindows PowerShell
Windows PowerShell is Microsoft's task automation framework, consisting of a command-line shell and associated scripting language built on top of, and integrated with the .NET Framework...
,
date
is a short form for the Get-Date
Cmdlet which returns the current system time object. The Set
verb of the Cmdlet is used to set both date and time.Microsoft Windows (cmd.exe)
Note: When these commands are called from the command line or a batch script, they will display the time or date and wait for the user to type a new time or date and press RETURN. The parameter '/t' will bypass asking the user to reset the time or date.
The format of the date parameter is dependent upon regional settings.
4DOS/4NT
Windows PowerShell
OS/2 (cmd.exe)
Note:
/N
means no prompt for TIME
. This parameter is not available in the DATE
command.Microsoft Windows (cmd.exe)
- To set the computer clock to 3:42 P.M., either of the following commands can be used:
- To change the date to November 16, 1982, any of the following can be entered at the prompt:
- To display the current system date, type the following command:
4DOS/4NT
- Display the current system time:
- Display the system date:
Windows PowerShell
- Adjust the current system time by -5 minutes:
- Return the number of days between now and a given date:
- Return the current system time and display it in a localized date and time format:
OS/2 (cmd.exe)
- Display the current system time:
- Display the system date: