Frank S.: Fortsetzung: Datum ... schon wieder ...

Beitrag lesen

Hier der 2te Teil des Postings.

_______________________________________________________________
         %Om    month in alternative numeric representation            
         _______________________________________________________________
         %OM    minutes in alternative numeric representation          
         _______________________________________________________________
         %OS    seconds in alternative numeric representation          
         _______________________________________________________________
         %Ou    weekday in the alternative format (Monday = 1)        
         _______________________________________________________________
         %OU    week of the year in alternative numeric representation
                 (same as for %U)                                      
         _______________________________________________________________
         %OV    week of the year in alternative numeric representation
                 (same as for %V)                                      
         _______________________________________________________________
         %Ow    weekday in the alternative format (Sunday = 0)        
         _______________________________________________________________
         %OW    week of the year in alternative numeric representation
                 (same as for %W)                                      
         _______________________________________________________________
         %Oy    year in the alternative format                        
         _______________________________________________________________

Format 2: Set system clock

date[ -a[ -] ssss.fff][ -u][ new_date]

This format is for the system administrator only.

This format can be used to adjust the system clock or reset the date.

-a[ -] ssss.fff
          Adjusts the system clock time by ssss.fff seconds, where 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 changed by the specified amount (ssss may not
          exceed 2146).

-u   Sets the date and time in Greenwich Mean Time (see option -u
          under Format 1).

new_date
          date sets the date and time of the system clock to the specified
          value. The following can be entered for [mmdd]HHMM or
          mmddHHMM[cc]yy:

____________________________________________________________________
       mm       dd       HH       MM       cc       yy        
      ______________________________________________________________
       month     day       hour     minute   century   year (last
       (01 - 12) (01 - 31) (00 - 23) (00 - 59) minus 1   2 digits)  
      ______________________________________________________________

mmdd not specified:

date assumes that the specified time HHMM refers to the current
          date.

cc not specified:

date assumes that the specified date mmddHHMMyy refers to the
          current century.

The system clock should only be set in single-user mode when all file
     systems have been unmounted. Changing the system clock may otherwise
     lead to inconsistencies in the file systems.

ERROR MESSAGES
   Format 2

date: no permission.

You have tried to set the system clock as a normal user. This
     privilege is reserved for the system administrator.

date: bad conversion.

You have attempted to set the system clock but have called date with
     an incorrect format.

ENVIRONMENT VARIABLES
     TZ   If defined, the environment variable TZ contains information on
          timezones. date uses TZ to determine the timezone and to convert
          from UTC (Universal Time Coordinated) to local time and vice
          versa.

The value of TZ consists of

-  the standard timezone

-  the offset from UTC in hours

-  if relevant, the summer timezone with information for conver-
             sions from standard time to summer time (daylight saving time)
             and back.

A detailed description of TZ is provided under sh(1) in the sec-
          tion "Standard shell variables".

LOCALE
     The LC_MESSAGES environment variable governs the language in which
     message texts are displayed.

The LC_TIME environment variable governs the language and the format
     in which the date and time and the values of date and time constants
     are displayed.

LC_CTYPE governs character classes and character conversion (shift-
     ing).

If LC_MESSAGES, LC_TIME or LC_CTYPE is undefined or is defined as the
     null string, it defaults to the value of LANG. If LANG is likewise
     undefined or null, the system acts as if it were not international-
     ized.

If any of the locale variables has an invalid value, the system acts
     as if none of the variables were set.

The LC_ALL environment variable governs the entire locale. LC_ALL
     takes precedence over all the other environment variables which affect
     internationalization.

EXAMPLES
     Example 1: Printing date and time (Format 1)

If you call date without arguments at 17:00 hours EST on July 15,
     1991, and the system clock is set to the correct time, the following
     will be printed:

Mon Jul 15 17:00:00 EST 1991

The command:

$ date '+DATE: %m/%d/%y%nTIME: %H:%M:%S'

generates the following output:

DATE: 07/15/91
     TIME: 17:00:00 If you now call date without arguments at 17:05 hours
     EST on July 15, 1991, and the system clock is set to the correct time,
     the following will be printed:

15 July 91

Example 2: Setting the system clock (Format 2)

You are working under the system administrator login root and want to
     set the date and time to 16:30 on March 17, 1991. To do this, you must
     first switch to single-user mode and unmount all file systems. You
     then enter:

# date 0317163091

If you are calling date in the year 1991, there is no need to specify
     the year.

SEE ALSO
     cal(1), sysadm(1M), ctime(3C), printf(3S), strftime(4), environ(5).