Simplest would be to leverage the DateTimeToNtpTimestamp() built-in commands - put the start date into a NTP int64 and the end date as well, then get the difference and divide by the constant needed to get to days (371,085,174,374,400i64?).
Lot’s of ideas, gotchas and info in this old thread: