Dim t1,t2, t3 As Long
Dim dd_day, dd_mth, dd_year As Int
t1 = DateUtils.SetDate(2025,10,27) 'Set date to 27th October 2025
t2 = DateTime.TicksPerDay
t3 = t1 + t2 'add one day to 27th October
dd_day = DateTime.GetDayOfMonth(t3) 'The date increments by one to 28th October
dd_mth = DateTime.GetMonth(t3)
dd_year = DateTime.GetYear(t3)
t1 = DateUtils.SetDate(2025,10,26) 'Set date to 26th October 2025 (last Sunday of October)
t2 = DateTime.TicksPerDay
t3 = t1 + t2 'add one day to 26th October
dd_day = DateTime.GetDayOfMonth(t3) 'The date remains at 26th October!!
dd_mth = DateTime.GetMonth(t3)
dd_year = DateTime.GetYear(t3)