timtbl(M) 19 June 1992 timtbl(M) Name timtbl - create a time locale table Syntax timtbl [ specfile ] Description The utility timtbl is provided to allow new LCTIME locales to be defined. It reads a specification file, which contains definitions of the way in which time and date information is presented for a particular locale, and produces a binary table file, to be read by setlocale(S), which determines the behavior of the strftime(S) routine. The information supplied in the specification file consists of lines in the following format: item = string The ``='' can be separated from the item and string fields by zero or more space or tab characters. The following values are meaningful for item: DATEFMT specification of the format string for representing the date. It will contain ``%'' directives representing variable items such as the month number, as used in the format string for strftime(S). TIMEFMT specification of the format string for representing the time of day. FNOON string indicating 12-hour clock times before midday, for example ``AM''. ANOON string indicating 12-hour clock times after midday, for exam- ple ``PM''. DTFMT string for formatting combined date and time. DAY1 full name of the first day of the week (Sunday). . . . DAY7 full name of the seventh day of the week. ABDAY1 abbreviated name of the first day of the week, for example ``Sun''. . . . ABDAY7 abbreviated name of the seventh day of the week. MON1 full name of the first month in the Gregorian calendar. . . . MON12 full name of the twelfth month. ABMON1 abbreviated name of the first month. . . . ABMON12 full name of the twelfth month. The string is a sequence of characters surrounded by quotes ("). Charac- ters within the string can be specified both literally and using ``\'' escapes; the following three strings are equivalent: "Tuesday" - literal "\x54ue\x73da\x79" - hexadecimal escapes "\124ue\163da\171" - octal escapes The strings for the items DATEFMT, TIMEFMT and DTFMT will also include ``%'' directives as detailed in the strftime(S) manual page, to specify variable portions of the string. All characters following a hash (#) are treated as a comment and ignored up to the end of the line, unless the hash is within a quoted string. The various items may be specified in any order. If any items are not specified, a warning message will be produced, and the null string ("") substituted. The binary table output is placed in a file named ``time'', within the current directory. This file should be copied or linked to the correct place in the setlocale file tree (see locale(M)). To prevent accidental corruption of the output data, the file is created with no write permis- sion; if the timtbl utility is run in a directory containing a write- protected ``ctype'' file, the utility will ask if the existing file should be replaced: any response other than ``yes'' or ``y'' will cause timtbl to terminate without overwriting the existing file. If the specfile argument is missing, the specification information is read from the standard input. See also chrtbl(M), locale(M), numtbl(M), setlocale(S), strftime(S) Diagnostics If the input table file cannot be opened for reading, processing will terminate with the error message, ``Cannot open specification file''. Any lines in the specification file which are syntactically incorrect, or contain an unrecognized value for the item, will cause an error message to be issued to the standard error output, specifying the line number on which the error was detected. The line will be ignored, and processing will continue. If a particular item is specified more than once, a warning message will be produced, and processing will continue. If the specification file does not contain specifications for all possi- ble items, a warning message will be produced. If the output file, time, cannot be opened for writing, processing will terminate with the error message, ``Cannot create table file''. Any error conditions encountered will cause the program to exit with a non-zero return code; successful completion is indicated with a zero return code. Notes The strings DFMT, TFMT, AMSTR and PMSTR may be used as alternatives to DATEFMT, TIMEFMT, FNOON and ANOON respectively, if required. These alternatives are provided for consistency with the identifiers used by nllanginfo(S). Value added timtbl is an extension of AT&T System V provided by The Santa Cruz Opera- tion, Inc.