Red Hat Linux 9 Professional Secrets [Electronic resources]

Naba Barkakati

نسخه متنی -صفحه : 341/ 206
نمايش فراداده

date

Purpose

Display the current date and time or set a new date and time.

Syntax

date [options] [+

format

]

date [-su] [

MMDDHHMM

[[

CC

]

YY

][.

SS

]]

Options

-u displays or sets the time using Greenwich Mean Time (GMT).

Description

The

date command alone displays the current date and time. Using the

+

format argument, you can specify a display format for the date and time. For a complete listing of the format specification, type man date.

To set the date, use

date followed by the date and time in the

MMDDHHMM format, where each character is a digit (

MM is the month,

DD is the day,

HH the hour, and

MM the minutes). You can optionally specify the year (

YY ) and century (

CC ) as well.