I think this open issue is related to what you are trying to do.
It seems if you try and convert the string fetched through a pulldata() function into a date, the XLSForm will not validate. And to calculate the number of days you will need to be use decimal-date-time() to convert your string. See this example:
Dates are tricky.
One person did a workaround of the javarosa issue by storing the date as a number in the csv (a number that is the same value that using decimal-date-time() on the date string would give). So in your CSV you would add a column with a formula such as =(A3-DATE(1970,1,1)) playing_with_dates.xlsx (10.3 KB) and demo.csv (74 Bytes)
However, because of time of day, there are some oddities that emerge. For example when considering the time of day. Note the slight difference in number of days difference below.
To calculate the number of whole years, such as the age of a person, using the div 365.25 technique can sometimes error if the month and day of month are close. As noted in the first post I linked:
Note that I posted an exploration of that here with what (I think) should be an alternate way to calculate it: