_strdate, _wstrdate
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

_strdate, _wstrdate

Copy a date to a buffer.

char *_strdate(
   char *datestr 
wchar_t *_wstrdate(
   wchar_t *datestr 


A pointer to a buffer containing the formatted date string.

Return Value

Each of these functions returns a pointer to the resulting character string datestr.


The _strdate function copies a date to the buffer pointed to by datestr, formatted mm/dd/yy, where mm is two digits representing the month, dd is two digits representing the day, and yy is the last two digits of the year. For example, the string 12/05/99 represents December 5, 1999. The buffer must be at least 9 bytes long.

_wstrdate is a wide-character version of _strdate; the argument and return value of _wstrdate are wide-character strings. These functions behave identically otherwise.

Generic-Text Routine Mappings

TCHAR.H routine _UNICODE & _MBCS not defined _MBCS defined _UNICODE defined
_tstrdate _strdate _strdate _wstrdate


Routine Required header Compatibility
_strdate <time.h> Win 98, Win Me, Win NT, Win 2000, Win XP
_wstrdate <time.h> or <wchar.h> Win 98, Win Me, Win NT, Win 2000, Win XP

For additional compatibility information, see Compatibility in the Introduction.


All versions of the C run-time libraries.


See the example for time.

See Also

Time Management Routines | asctime | ctime | gmtime | localtime | mktime | time | _tzset | Run-Time Routines and .NET Framework Equivalents

© 2016 Microsoft