With your date fields with a display format of "MMM DD, YYYY", you can place the following script in the "DateTimeRequested" field's exit event:
var msg = Concat("DateTimeRequested.rawValue = ", DateTimeRequested.rawValue, "\u000a")
var RequestedRV = Date2Num(DateTimeRequested.rawValue)
msg = Concat(msg, "Date2Num(DateTimeRequested.rawValue) = ", RequestedRV, "\u000a")
var RequestedFV = Date2Num(DateTimeRequested.formattedValue, "MMM DD, YYYY")
msg = Concat(msg, "Date2Num(DateTimeRequested.formattedValue, 'MMM DD, YYYY') = ", RequestedFV , "\u000a \u000a" )
msg = Concat(msg, "DateTimeNeeded.rawValue = ", DateTimeNeeded.rawValue, "\u000a")
var NeededRV = Date2Num(DateTimeNeeded.rawValue)
msg = Concat(msg, "Date2Num(DateTimeNeeded.rawValue) = ", NeededRV, "\u000a")
var NeededFV = Date2Num(DateTimeNeeded.formattedValue, "MMM DD, YYYY")
msg = Concat(msg, "Date2Num(DateTimeNeeded.formattedValue, 'MMM DD, YYYY') = ", NeededFV, "\u000a \u000a" )
var Diff = NeededFV - RequestedFV
xfa.host.messageBox(Concat(msg, "Difference in days: ", Diff), "Difference in Days", 1)
When you fill in both dates and exit the needed field you will get a pop-up showing the results.
Note: it is best to set the "Display Pattern" and use the same pattern for the "format" parameter in the Date2Num funciton as this is a value that you can control and know will be correct for the conversion.