Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ date(1) — DG/UX 4.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought



                                                                  date(1)



        _________________________________________________________________
        date                                                      Command
        print and set the date
        _________________________________________________________________


        SYNTAX

        date [ mmddhhmm[yy] ] [ +format ]


        DESCRIPTION

        If no argument is given, or if the argument begins with +, the
        current date and time are printed.  Otherwise, the current date
        is set. Only the superuser can set the date; attempts by other
        users generate a permission error.  The first mm is the month
        number; dd is the day number in the month; hh is the hour number
        (24-hour system); the second mm is the minute number; and yy is
        the last two digits of the year number and is optional.  For
        example:

             date 10080045

        sets the date to Oct 8, 12:45 a.m.  The current year is the
        default if no year is mentioned.  The system operates in GMT.
        Date takes care of the conversion to and from local standard and
        daylight time.

        If the argument begins with +, the output of date is under the
        control of the user.  The format for the output is similar to
        that of the first argument to printf(3S).  All output fields are
        of fixed size (zero padded if necessary).  Each field descriptor
        is preceded by % and will be replaced in the output by its
        corresponding value.  A single % is encoded by %%.  All other
        characters are copied to the output without change.  The string
        is always terminated with a new-line character.

        Field Descriptors:

             n    Insert a new-line character
             t    Insert a tab character
             m    Month of year--01 to 12
             d    Day of month--01 to 31
             y    Last two digits of year--00 to 99
             D    Date as mm/dd/yy
             H    Hour--00 to 23
             M    Minute--00 to 59
             S    Second--00 to 59
             T    Time as HH:MM:SS
             j    Day of year--001 to 366



        DG/UX 4.00                                                 Page 1
               Licensed material--property of copyright holder(s)





                                                                  date(1)



             w    Day of week--Sunday = 0
             a    Abbreviated weekday--Sun. to Sat.
             h    Abbreviated month--Jan. to Dec.
             r    Time in a.m./p.m.  notation



        _________________________________________________________________
        EXAMPLES

        $ date

        Thu Nov 20 09:25:49 EST 1987

        Date, with no arguments, gives the current date and time.

        $ date '+%D  %T%nIt is the %jth day of the year!'

        11/20/87  09:30:31
        It is the 324th day of the year!

        $

        The date command above shows the use of the field descriptors.
        _________________________________________________________________


        DIAGNOSTICS

        No permission
             If you are not the superuser and you try to change the date;

        Bad conversion
             If the date set is syntactically incorrect;

        Bad format character
             If the field descriptor is not recognizable.


        SEE ALSO

        printf(3S) in the Programmer's Reference for the DG/UX System


        WARNING

        It is a bad practice to change the date while the system is
        running multi-user.






        DG/UX 4.00                                                 Page 2
               Licensed material--property of copyright holder(s)



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026