#include <wchar.h>
|
|
size_t
wcsftime (wchar_t * restrict wcs, size_t maxsize, const wchar_t * restrict format, const struct tm * restrict timeptr); |
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.
#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;
}
|
© 2007-2009 Nokia Corporation. All rights reserved. This documentation can be used in the connection with this Product to help and support the user. |
|