XLL+ Class Library

::XlStringToDate

Transform a string to year, month and day

[C++]
int XlStringToDate(
   const char* str,
   int* yy,
   int* mm,
   int* dd
);

Parameters

str

A string containing a date. Excel will use the date formatting rules currently in force to read the string.

yy

Pointer to variable which will contain year (eg 1996).

mm

Pointer to variable which will contain month (1-12).

dd

Pointer to variable which will contain day of month (1-31).

Return value

1 if the function succeeds; 0 if it fails

Remarks

This function calls Excel's DATEVALUE(), YEAR(), MONTH() and DAY() functions to transform a string date into its components.

Because it uses Excel for the transformation, it handles variations in the Excel base date transparently.

Requirements

Header: xlldate.h

See Also

Global date functions