I did some more testing. Dates work fine - no tagattr clause needed, just a properly formatted SAS date. Also, converting the datetime to an excel numeric representation of a datetime works - I used tagattr and set the type as Number with a date format. See below: proc format lib=work;
picture dtspec
. = ' '
other='%0d/%0m/%Y %0H:%0M:%0S' (datatype=datetime );
;
run;
data date_test(keep=test:);
format testdatetime dtspec. testdate ddmmyy10.;
testdatetime='01JAN2018 08:36:09'dt;
testdate = today();
testxldate = 43101.3723263889;
run;
ods listing close;
ods excel file="/<path>/testdates.xlsx";
proc report data = date_test;
title j=l "Test";
column testdate testdatetime testxldate;
define testdate / display;
define testdatetime / style(column)={tagattr='type:Date format:dd/mm/yy;'} display;
define testxldate / style(column)={tagattr='type:Number format:dd/mm/yy;'} display;
run;
ods excel close;
ods listing;
... View more