XLL+ Class Library (6.3)

::XlStringToLSerial

Transform a string to a serial date

int XlStringToLSerial(
   const char* str,
   long* date
);
int XlStringToLSerial(
   const wchar_t* str,
   long* date
);

Parameters

str

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

date

Pointer to a variable which will be filled with a serial date value (as used by Excel).

Return Value

1 if the function succeeds; 0 if it fails

Remarks

This function calls Excel's DATEVALUE() function 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