Name

wstrdate - gets the system date in wide-character format.

Library

libc.lib

Synopsis

  #include <wchar.h>
  wchar_t* wstrdate (const wchar_t *datestr);

Detailed description

The wstrdate() function gets the system date and converts it into wide-character string. This copies the current system date into the string pointed by datestr in the format dd/mm/yyyy, the datestr buffer must be atleast 11 bytes long.It returns a pointer to the datestr string. Because the modification is done in place, the pointer returned is the same as the pointer passed as the input argument.

Return values

The wstrdate() returns a pointer to the date string, on success else it returns NULL pointer and sets the errno accordingly.

Examples

#include <wchar.h>
/* Illustrates how to use wstrdate API */
int example_wstrdate(void)
{ 
  /* input string which is updated with the system date. */
  wchar_t datestr[20];
 
  wchar_t *res = NULL;
    
  /* function call to get the system date in wide-char format */
  res = wstrdate(datestr);
  if( !res && !datestr)
  {
        printf(" res - %s and datestr - %s",res, datestr);
        return 0;
  }
  else
        return -1;
}

Output

 res - 21/11/2006 and datestr - 21/11/2006


Errors

The wstrdate function will fail if:
[EFAULT]
  The supplied argument datestr is invalid.

See also

strdate, strftime, strptime, wstrtime.

Feedback

For additional information or queries on this page send feedback

© 2008 Nokia Corporation. All rights reserved. This documentation can be used in the connection with this Product to help and support the user.

Top