Name
wcsftime - duplicate a wide-character string
Library
libc.lib
Synopsis
|
size_t
wcsftime (wchar_t * restrict wcs, size_t maxsize, const wchar_t * restrict format, const struct tm * restrict timeptr);
|
Return values
wcsftime
shall return the number of wide-character codes placed into the array pointed to by
wcs
, not including the terminating null wide-character code. Otherwise, zero is returned and the contents of the array are unspecified.
Detailed description
The
wcsftime
function is equivalent to the
strftime
function except for the types of its arguments.
Refer to
strftime
for a detailed description.
Examples
#include <wchar.h>
#include <time.h>
/* Illustatrates how to use wcsftime API */
int example_wcsftime()
{
wchar_t datestring[50];
int retval;
struct tm *tm;
/* get the current time */
time_t t = time(NULL);
/* get the local time from the current time */
tm = localtime(&t);
/* convert date and time to a wide-character string */
retval = wcsftime(datestring,15,L"%A",tm);
/* If the total number of resulting wide-character codes */
/* including the terminating null wide-character code is */
/* no more than maxsize, wcsftime() shall return the number */
/* of wide-character codes placed into the array pointed to */
/* by wcs, not including the terminating null wide-character */
/* code. Otherwise, zero is returned and the contents of the */
/* array are unspecified.*/
return retval;
}
Feedback
For additional information or queries on this page send feedback
© 2005-2007 Nokia
|
|