One day subtracted from ToDo's

Can anyone explain why a whole day gets subtracted from some types of To-Do? A To-do has a start-date, start-time, end-date, end-time, and a Duration field. This is the code called from the Create To-do form to calculate the End-date. Maybe the intention was to add a whole day, and the -1 should be a +1? IF (Type <> Type::Meeting) OR "All Day Event" THEN TempEndDateTime := CREATEDATETIME(Date - 1,"Start Time") + Duration ELSE TempEndDateTime := CREATEDATETIME(Date,"Start Time") + Duration;

Hi, if the if-clause is fullfilled then the duration is automatically set to 1D. In Order to set the end date to the same date as start date this calculation subtracted 1 day from the startdate. The End date is set to start date because the To-Do should be done at this day. Regards, Frank

Thanks for the explanation. Alastair