I am having trouble adding a number of days to a date.
In the example below I start with a date of 4/7/19 and add 365 days to it, I would expect the answer to come out as 4/7/20 but instead the answer is coming out as 4/6/20 and I cannot work out why.
Any help would be much appreciated.
Many Thanks
Code: Select all
on mouseup
put "4/7/19" into t_date
put "365" into t_days_valid_for
Convert t_date from date to seconds
put t_days_valid_for * "86400" into t_days_valid_for --this converts the number of days valid for to seconds
put t_date + t_days_valid_for into t_expiry_date
convert t_expiry_date to date
answer t_expiry_date
end mouseup