XLL+ Class Library (7.0)

CXlDate::LSerialToDate

Transform an integer Excel serial date to year, month and day

static void LSerialToDate(
   long date,
   int& yy,
   int& mm,
   int& dd
);

Parameters

date

An integer serial date value.

yy

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

mm

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

dd

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

Remarks

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

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

Exceptions

If a call to the Excel API fails, then an exception of type CXlApiException will be thrown. Since this exception is derived from CXlRuntimeException, it will be caught by the add-in wrapper function when this method is called from within an add-in function.

Requirements

Header: xlldate.h

See Also

CXlDate Class | CXlDate Methods