Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ NLtmtime(3) — AIX/RT 2.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ctime, localtime, gmtime, asctime, tzset

NLstrtime

scanf, fscanf, sscanf, NLscanf, NLfscanf, NLsscanf

environment

date

ctime

NLtmtime

Purpose

     Sets a time structure from string data.

Syntax

     #include  (time.h)

     int NLtmtime (str, format, ptm)
     char *str, *format;
     struct tm *ptm;

Description

     The NLtmtime subroutine  sets the fields in  the ptm time
     structure with information  in a str text  string that is
     parsed according  to the  format string.  For  each field
     descriptor in  the format string,  data is read  from the
     str string and placed into  appropriate fields of the ptm
     structure.   The  format  string is  described  by  these
     rules:

     o   Each field descriptor begins with a % (percent sign).
     o   A mnemonic string of 1  or 2 characters follows the %
         sign and indicates the type  of field or fields being
         read.
     o   A blank character (tab,  space, or newline character)
         anywhere in the format  string causes all blank char-
         acters  at  the  corresponding location  in  the  str
         string to be skipped.
     o   Any character in the format  string that appears in a
         field  descriptor, other  than  the blank  character,
         must be matched exactly by  the same character in the
         str  string.  If  a mismatch  occurs, NLtmtime  stops
         processing and any information following the mismatch
         is ignored.  The characters and their meanings are:

         m    The  month of  the year  is output  as a  number
              between 01 and 12.

         h    The  short month  is output  as a  string estab-
              lished  by  the  environment  variable  NLSMONTH
              ("Jan", for example).

         lh   The long month is output as a string established
              by the environment variable NLLMONTH ("January",
              for example).

         d    The  day of  the  month is  output  as a  number
              between 01 and 31.

         j    The Julian day of the year is output as a number
              between 001 and 366.

         w    The  day  of the  week  is  output as  a  number
              between 0 and 6.

         a    The short day of the  week is output as a string
              according  to  the  environment  variable  NLDAY
              ("Mon", for example).

         la   The long day of the  week is output according to
              the environment  variable NLLDAY  ("Monday", for
              example).

         y    The year  is output as  a number between  00 and
              99.

         Y    The year is output as  a number between 0000 and
              9999.

         D    The date  is output  in the format  specified by
              the environment variable NLDATE ("05/05/86", for
              example).

         lD   The long date is  output in the format specified
              by  the environment  variable NLLDATE  ("Jul 04,
              1986", for example).

         sD   The short date is output in the format specified
              by the (long date) environment variable NLLDATE,
              but the year is omitted ("July 7", for example).

         H    The  hour  of the  day  is  output as  a  number
              between 00 and 23.

         sH   The  hour  of the  day  is  output as  a  number
              between 01 and 12.

         M    The minute is output as  a number between 00 and
              59.

         S    The second is output as  a number between 00 and
              59.

         p    The AM  or PM  indicator is  output as  a string
              specified  by   environmental  variable  NLTMISC
              ("am", for example).

         z    The (standard or daylight-saving) time zone name
              is output as a string from the environment vari-
              able TZ ("CDT", for example).

         r    The time  is output  in the format  specified by
              the environment variable NLtime,  but using a 12
              hour clock ("7:07:50 pm", for example).

         T    The time  is output  in the format  specified by
              the environment variable NLtime ("19:07:50", for
              example).

         sT   The time  is output  in the format  specified by
              the  environment variable  NLTIME, but  omitting
              the seconds ("19:07", for example).

     The  field descriptors  are  the same  as  those used  by
     NLstrtime except  for those that do  not specify informa-
     tion.

Related Information

     In  this  book:    "ctime,  localtime,  gmtime,  asctime,
     tzset,"  "NLstrtime,"   "scanf, fscanf,  sscanf, NLscanf,
     NLfscanf, NLsscanf," and "environment."

     The date and ctime commands  in AIX Operating System Com-
     mands Reference.

     "Overview of International Character Support" in Managing
     the AIX Operating System.

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