Can anyone give me an idea to find a date of a next week?
For example, if today is 4 (Wed) and next Wed will be 11 ( +7 day ). 11 is the number what I want to get.
However, the last date of each month is different such as 30 / 31 so I should consider it.
I am wondering if there is any function to find that number.
Thanks.
My_Date.Day = My_Date.Day + 1
And when todays day is 25, just consider the Month # change
dim now as new date
Now.totalseconds = now.totalseconds + 86400 * 7
Dim newday as integer = now.day
I have an Extends module for the Classic date. It has many date handling methods that are all extensions.
Download here.
@ Greg.
I didn’t know that ‘totalseconds’ considers 30/31 automatically for the month. It works well. Thank you.
@ Simon
It will be really helpful.
Thanks a lot.
Here’s an alternative using the new Xojo framework:
Using Xojo.Core
Dim oneWeek As New DateInterval(0, 0, 7)
Dim nextWeek As Date = Date.Now + oneWeek
Dim dayNum As Integer = nextWeek.Day