# Calculate 10 days from current day minus weekends

Page 1 of 1

## 3 Replies - 1199 Views - Last Post: 22 January 2014 - 02:14 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'https://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=338721&amp;s=47159f62971d9608a2f75e8544e460ac&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 jose.rodriguez.an

Reputation: 0
• Posts: 58
• Joined: 18-April 13

# Calculate 10 days from current day minus weekends

Posted 22 January 2014 - 01:43 PM

Hi all,

I need to calculate the date 10 days after the current date minus the weekends.

Someone could help me?. .
Is This A Good Question/Topic? 0

## Replies To: Calculate 10 days from current day minus weekends

### #2 modi123_1

• Suitor #2

Reputation: 14569
• Posts: 58,424
• Joined: 12-June 08

## Re: Calculate 10 days from current day minus weekends

Posted 22 January 2014 - 01:48 PM

What have you tried/looked into/etc?

### #3 jose.rodriguez.an

Reputation: 0
• Posts: 58
• Joined: 18-April 13

## Re: Calculate 10 days from current day minus weekends

Posted 22 January 2014 - 02:09 PM

I have this code i am using for the opposite, and I discounting the weekends. But now I have to do the opposite and i am broken my mind and I cant achieve what i want.

Private Sub DateCC1TP_ValueChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DateCC1TP.ValueChanged
Dim startdate As Date = DateCC1TP.Value
Dim Finishdate As Date = Now.Date
Dim offday As Byte = 0

'Calcular fechas CC1
Dim dias As Long = DateDiff(DateInterval.Day, startdate, Finishdate)

If startdate > Finishdate Then
CalTxt.Text = 0
MsgBox("Date is higher than actual", MsgBoxStyle.OkOnly)
ElseIf startdate <= Finishdate Then
'Bucle para contar los fines de semana
Do
'Resta dos para los fines de samana
If startdate.DayOfWeek = DayOfWeek.Sunday Then
offday += 2
End If

Loop Until startdate > Finishdate

'Aņadir dia de inicio y de hoy.
dias += 2
'Restar dias de fiesta
dias -= offday

CalTxt.Text = dias & " days"
End If
End Sub

### #4 modi123_1

• Suitor #2

Reputation: 14569
• Posts: 58,424
• Joined: 12-June 08

## Re: Calculate 10 days from current day minus weekends

Posted 22 January 2014 - 02:14 PM

Perhaps you need to take a break from the code then?

Aside from the programming of one case - what is your general logic for this new case? Do you have that much?