Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ NLtmtime(3) — AIX PS/2 1.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ctime, localtime, gmtime, asctime, tzset

NLstrtime

scanf, fscanf, sscanf, NLscanf, NLfscanf, NLsscanf, wsscanf

setlocale

environment

date



NLTMTIME(3,L)               AIX Technical Reference               NLTMTIME(3,L)



-------------------------------------------------------------------------------
NLtmtime



PURPOSE

Sets a time structure from string data.

LIBRARY

Standard C Library (libc.a)

SYNTAX

#include <time.h>

int NLtmtime (str, format, ptm)
unsigned 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 new-line character) anywhere in the
    format string causes all blank characters at the corresponding location in
    the str string to be skipped.
  o Any character in the format string that appears outside of 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 input as a number between 01 and 12.

    h   The short month is input as a string established by the corresponding
        entry in the current environment file or the C locale, if applicable
        (see "setlocale").

    lh  The long month is input as a string established by the corresponding
        entry in the current environment file or the C locale, if applicable
        (see "setlocale").





Processed November 7, 1990       NLTMTIME(3,L)                                1





NLTMTIME(3,L)               AIX Technical Reference               NLTMTIME(3,L)



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

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

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

    a   The short day of the week is input as a string according to the
        corresponding entry in the current environment file or the C locale, if
        applicable (see "setlocale").

    la  The long day of the week is input according to the corresponding entry
        in the current environment file or the C locale, if applicable (see
        "setlocale").

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

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

    D   The date is input in the format specified by the corresponding entry in
        the current environment file or the C locale, if applicable (see
        "setlocale").

    lD  The long date is input in the format specified by the corresponding
        entry in the current environment file or the C locale, if applicable
        (see "setlocale").

    sD  The short date is input in the format specified by the corresponding
        entry in the current environment file or the C locale, if applicable
        (see "setlocale").

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

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

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

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

    p   The AM or PM indicator is input as a string specified by corresponding
        entry in the current environment file or the C locale, if applicable
        (see "setlocale").

    z   The (standard or daylight-saving) time zone name is input as a string
        from the corresponding entry in the current environment file or the C
        locale, if applicable (see "setlocale").

    r   The time is input in the format specified by the corresponding entry in
        the current environment file or the C locale, if applicable (see
        "setlocale").






Processed November 7, 1990       NLTMTIME(3,L)                                2





NLTMTIME(3,L)               AIX Technical Reference               NLTMTIME(3,L)



    T   The time is input in the format specified by the corresponding entry in
        the current environment file or the C locale, if applicable (see
        "setlocale").

    sT  The time is input in the format specified by the corresponding entry in
        the current environment file or the C locale, if applicable (see
        "setlocale").


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

RELATED INFORMATION

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

The date command in AIX Operating System Commands Reference.

"Introduction to International Character Support" in Managing the AIX Operating
System.

AIX Guide to Multibyte Character Set (MBCS) Support.































Processed November 7, 1990       NLTMTIME(3,L)                                3



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