admin管理员组

文章数量:1122889

hpunix修改服务器时间,HP

HP-UX更改系统时间 使用命令date命令 如果使用date -u 修改时间,需要当前时间减去8小时

本机为当地北京时间08:44:30,需要系统时间设置如下:

$

date                              ----表示EAT东区时间

2013年1月8日 星期二, 08:44:30

$ date -u                           ----表示UTC(UTC-8=EAT)时间,翻译过来是:协调世界时(Universal Time Coordinated)

date(1)                                                            date(1)

NAME

date - display or

set the date and time

SYNOPSIS

date [-u]

date [-u]

+format

date [-u]

[mmddhhmm[[cc]yy]]

date [-a

[-]sss[.fff]]

DESCRIPTION

The

date command displays or sets the current HP-UX system clock

date

and time. Since the HP-UX system

operates in Coordinated Universal

Time (UTC),

date automatically converts to and from local standard

or

daylight/summer time, based on your TZ

environment variable. See

Environment

Variables in EXTERNAL INFLUENCES below.

Options

date recognizes the following

option:

-u  Input and output values in Coordinated Universal Time

(UTC),

functionally equivalent to Greenwich Mean Time

(GMT),

instead of in local

time.

-a

[-]sss[.fff]

Slowly adjust the time by sss.fff seconds (fff

represents

fractions of a second). This adjustment can be positive

or

negative. The system's clock will be sped up or slowed

down

until it has drifted by the number of seconds

specified.

Formats

The date command has two forms for displaying the date and time

and

one form for setting

them.

date

[-u]

Display the current date and time. The output is

the

same as for the %c formatting directive for all

languages

except the C default language. See Formatting

Directives

and EXAMPLES

below.

date

[-u]

+format

Display the current date and time according to

formatting

directives specified in format, which is a string of

zero

or more formatting directives and ordinary

characters.

If it contains blanks, enclose it in apostrophes

or

quotation marks.

Hewlett-Packard

Company           - 1

-  HP-UX Release 11i: November

2000

date(1)                                                            date(1)

See Formatting Directives

below.

All ordinary characters are copied unchanged into

the

output

string.

The output string is always terminated with a

newline

character.

If + is specified and format is omitted, only a

newline

is output.

date [-u]

[mmddhhmm[[cc]yy]]

Set the HP-UX system clock to the date and

time

specified. You require the superuser

privilege.

If you include the -u option, the specified date and

time

is assumed to be in Coordinated Universal Time

(UTC).

The numeric argument is interpreted left to right

in

two-digit pairs as

follows:

mm  Month number

[01-12].

dd  Day number in the month

[01-31].

hh  Hour number (24-hour system)

[00-23].

mm  Minute number

[00-59].

cc  Century minus one

[19-20].

yy  Last two digits of the year number [70-99,

00-

37 (1970-1999, 2000-2037)]. If omitted,

the

current year is

used.

If you attempt to set the date backwards, date

generates

the

warning,

do you really want to run time

backwards?[yes/no]

Type yes or the equivalent for your locale to set

the

本文标签: hpunix修改服务器时间hp