Juvigy Posted May 22, 2018 Author Share Posted May 22, 2018 They are formatted as Date. I will try to use this functions instead in conjunction with the locale settings as a workaround: $sStartDate = "2018/05/16" $sEndDate = "2018/05/21" $iBussinessDays = _BussinessDays($sStartDate, $sEndDate) ConsoleWrite("There are " & $iBussinessDays & " bussiness days between " & $sStartDate & " and " & $sEndDate & @CRLF) Func _BussinessDays($sStartDate, $sEndDate) $iCounter = 0 $iDifferenceInDays = _DateDiff('D', $sStartDate, $sEndDate) For $i = 0 To $iDifferenceInDays $sNextDate = _DateAdd('D', $i, $sStartDate) $aSplitDate = StringSplit($sNextDate, "/") $sDayOfWeek = _DateToDayOfWeekISO($aSplitDate[1], $aSplitDate[2], $aSplitDate[3]) If $sDayOfWeek >= 1 And $sDayOfWeek <= 5 Then $iCounter += 1 EndIf Next Return $iCounter EndFunc ;==>_BussinessDays Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now