Time and date

Time and date

In computing, time and date are commands 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 COMMAND.COM, cmd.exe and 4DOS/4NT. The Unix command date displays both the time and date, but does not allow the normal users to change either. Users with superuser privileges may use date -s to change the time and date. The Unix command time performs a different function. In Windows PowerShell, 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.

yntax

The syntax of both commands differs depending on the specific platform and implemenation:

Microsoft Windows (cmd.exe)

time [/t] [/time] [hours: [minutes [:seconds [.hundredths] [{A|P}]

date [mm-dd-yy] [/t]

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.

4DOS/4NT

TIME [/T] [hh [:mm [:ss] [AM | PM]

hh: The hour (0 - 23).mm: The minute (0 - 59).ss: The second (0 - 59), set to 0 if omitted.

/T: (display only)

DATE [/T] [mm-dd-yy]

/T: (Display only)mm: The month (1 - 12).dd: The day (1 - 31).yy: The year (00 - 99, or a 4-digit year).

Windows PowerShell

Get-Date [-Date] ] [-Year ] [-Month ] [-Day ] [-Hour ] [-Minute ] [-Second ] ...

Set-Date [-Date] ...Set-Date [-Adjust] ...

OS/2 (cmd.exe)

TIME [hh-mm-ss] [/N]

DATE [mm-dd-yy] or [dd-mm-yy] or [yy-mm-dd] or [yy-dd-mm]

Note: /N means no prompt for TIME. This parameter is not available in the DATE command.

Examples

Microsoft Windows (cmd.exe)

*To set the computer clock to 3:42 P.M., either of the following commands can be used:

C:> time 15:42C:> time 3:42P

*To change the date to November 16, 1982, any of the following can be entered at the prompt:

C:> date11.16.8211-16-8211/16/82

*To display the current system date, type the following command:

date /t

4DOS/4NT

*Display the current system time:

C:PROGRAM FILESJPSOFT4DOS>time /t19:30:42

*Display the system date:

C:PROGRAM FILESJPSOFT4DOS>date /tWed 7.05.2008

Windows PowerShell

*Adjust the current system time by -5 minutes:

PS C:>Set-Date -Adjust (New-TimeSpan -Minutes -5)

Wednesday, May 07, 2008 7:25:42 PM

*Return the number of days between now and a given date:

PS C:>((date) - (date 11/16/1982)).Days9304

*Return the current system time and display it in a localized date and time format:

PS C:>$culture = new-object Globalization.CultureInfo 'de-DE'PS C:>(date).ToString($culture)07.05.2008 19:30:42

OS/2 (cmd.exe)

*Display the current system time:

[C:] timeCurrent time is: 7.30.42,21Enter the new time:

*Display the system date:

[C:] dateCurrent date is: Wed 7.05.2008Enter the new date: (dd.mm.yy)

ee also

*List of DOS commands
*List of Unix programs

References

* [http://technet.microsoft.com/en-us/library/bb491015.aspx Microsoft TechNet Time article]
* [http://technet.microsoft.com/en-us/library/bb490889.aspx Microsoft TechNet Date article]


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • Time and the Rani — ] [cite web url= http://www.shannonsullivan.com/drwho/serials/7d.html title= Time and the Rani publisher = A Brief History of Time Travel last = Sullivan first = Shannon date = 2007 08 07 accessdate = 2008 08 30] Preproduction*This story s… …   Wikipedia

  • Time and Relative — doctorwhobook title=Time and Relative series=Telos Doctor Who novellas number=1 featuring=First Doctor Susan writer=Kim Newman publisher=Telos Publishing Ltd. isbn= ISBN 1 903889 02 2 (standard) pages=120 date=November 2001 preceding=… …   Wikipedia

  • Time and the Gods — Infobox Book | name = Time and the Gods title orig = translator = image caption = author = Lord Dunsany illustrator = Sidney Sime cover artist = country = United Kingdom language = English series = genre = Fantasy short stories publisher =… …   Wikipedia

  • Time and Stars — Infobox Book | name = Time and Stars title orig = translator = image caption = Dust jacket from the first edition author = Poul Anderson illustrator = cover artist = country = United States language = English series = genre = Science fiction… …   Wikipedia

  • time and a half — noun Date: 1888 payment for work (as overtime or holiday work) at one and a half times the worker s regular wage rate …   New Collegiate Dictionary

  • Time from NPL — Map showing the location of the Anthorn VLF transmitter within Cumbria …   Wikipedia

  • The Watchers Out of Time and Others — Infobox Book | name = The Watchers Out of Time and Others title orig = translator = image caption = Dust jacket illustration by Herb Arnold for The Watchers Out of Time and Others author = H. P. Lovecraft and August Derleth illustrator = cover… …   Wikipedia

  • Of Time and Stars —   Cover of the 1st edition …   Wikipedia

  • Adventures in Time and Space — Infobox Book | name = Adventures in Time and Space title orig = translator = image caption = Dust jacket from the first edition author = edited by Raymond J. Healy and J. Francis McComas illustrator = cover artist = country = United States… …   Wikipedia

  • An act to regulate the time and manner of administering certain oaths — Infobox U.S. legislation name= An Act to regulate the Time and Manner of administering certain Oaths fullname= acronym= enacted by= 1st effective date= public law url= cite public law= cite statutes at large= 1 Stat. 23 (1789) acts amended= title …   Wikipedia

  • Time zone — Timezone and TimeZone redirect here. For other uses, see Time zone (disambiguation). Local time redirects here. For the mathematical concept, see Local time (mathematics). This article is about time zones in general. For a list of time zones by… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”