|
-
Dec 27th, 2007, 04:48 PM
#1
Thread Starter
Addicted Member
[2008] Checking for a specific date
I want to check if after one week from now is a specifc give date (for example is after one week 24/12? (DD/MM)
I am creating a simple birthday alarm program, it will check my data and tell me after one week is the birthday of bla.
here is my code, but its not working correctly
no errors are given, but its just not working:
Dim dt As DateTime = DateTime.Now
If (Val(BDay(x)) - dt.Day.ToString > 0 And Val(BDay(x)) - 7 = dt.Day.ToString And Val(BMonthNB(x)) = dt.Month.ToString) Or (Val(BDay(x)) - dt.Day.ToString < 0 And BMonth(x) = dt.AddMonths(CInt(-1)).ToString And 30 - Val(BDay(x)) - dt.Day.ToString) Then LstBirthday.Items.Add("After one week is the birthday of " & UserName(x))
BDay(x) is a string with the day number
BMonthNb(x) is a string with the month number
BMonth(x) is a string with the month name
this code is in a For Next loop
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|