DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

nl_cxtime(S)


nl_cxtime, nl_ascxtime -- format date and time

Syntax

cc -a ods30 ... -lc

#include <time.h>

char *nl_cxtime (clock, format) long *clock; char *format;

char *nl_ascxtime (tm, format) struct tm *tm; char *format;

Description

nl_cxtime- converts UNIX epoch time to local time

nl_ascxtime- converts a tm structure to a 26-character string

The routines nl_cxtime and nl_ascxtime provide an alternative interface to the ctime(S) routines for programs written to the X/OPEN Portability Guide, Issue 2, standard. However, both nl_cxtime and nl_ascxtime have been withdrawn from XPG3.

They provide the same functions as the ctime(S) routines ctime and asctime, except that a strftime(S) format string is provided to determine the layout of the resulting string.

The following field descriptors are accepted:

n insert a newline character
t insert a tab character
m month of year - 01 to 12
d day of month - 01 to 31
y last 2 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 61
T time as HH:MM:SS
j day of year - 001 to 366
w day of week - 0 to 6 (Sunday = 0)
a abbreviated weekday - Sun to Sat
h abbreviated month - Jan to Dec
r time in AM/PM notation

 n   insert a newline character
 t   insert a tab character
 m   month of year - 01 to 12
 d   day of month - 01 to 31
 y   last 2 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 61
 T   time as HH:MM:SS
 j   day of year - 001 to 366
 w   day of week - 0 to 6 (Sunday = 0)
 a   abbreviated weekday - Sun to Sat
 h   abbreviated month - Jan to Dec
 r   time in AM/PM notation
See strftime(S).

If format is the empty (zero length) string, the date and time format (D_T_FMT) of the currently selected LC_TIME locale is used.

The maximum length of the resultant string is defined by the constant NL_TEXTMAX in the limits.h file.

See also

ctime(S), difftime(S), mktime(S), limits(FP), nl_init(S), strftime(S), stime(S), time(S), timtbl(M)

Standards conformance

nl_cxtime and nl_ascxtime are obsolete and may not be supported on future releases. Use strftime(S) instead.


© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003