NWLstrftime(3nw)


NWLstrftime -- formats the time and date according to a specified format

Synopsis

   #include <time.h> 
   #include <stdio.h> or #define NWL_EXCLUDE_FILE 
   #include <nwlocale.h> 
   

size_t NWAPI NWLstrftime (char NWFAR *string, size_t maxSize, char NWFAR *format, struct tm NWFAR *timePtr);

Description

The parameters are as follows:

string
(OUT) Points to the buffer to contain date and time. If string is NULL, the length of the time string is returned.

maxsize
(IN) Specifies the maximum size of the buffer where the date and time string is placed.

format
(IN) Points to the specified format.

timePtr
(IN) Points to tm.

Return values

0x0000
maxsize is 0 or format is NULL.

Non-zero
Length of Formatted Time

Notices

NWLstrftime places characters into string as controlled by format.

The format can be date only, time only, or date and time. format values are specified below:

   %c      date and time 
   %x      date 
   %X      time 


NOTE: This is not a full ANSI implementation.

timePtr points to tm, which contains the locale time as follows:

   int      tm_sec; 
   int      tm_min; 
   int      tm_hour; 
   int      tm_mday; 
   int      tm_mon; 
   int      tm_year; 
   int      tm_wday; 
   int      tm_yday; 
   int      tm_isdst; 
If string is NULL, the length of the formatted string is still returned, but the formatted string is not.

Services

Internationalization

NCP calls

None

References

NWLsetlocale(3nw)
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.