Date Format error in cdtcomparison() function

A Score Level 2

I am using fn!cdtcomparison() function to find difference between two cdts. However, the result is converting date attribute to text with format 'yyyy-mm-dd hh:mm:aa'.

Can someone tell me how to detect and reformat it to datetime it in as it can be any attribute within the cdt. 

  Discussion posts and replies are publicly visible