DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

nl_cxtime(S-osr5)


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-osr5) 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-osr5) routines ctime and asctime, except that a strftime(S-osr5) 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-osr5).

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-osr5), difftime(S-osr5), mktime(S-osr5), limits(FP), nl_init(S-osr5), strftime(S-osr5), stime(S-osr5), time(S-osr5), timtbl(M)

Standards conformance

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


© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005