Date Adjustment To Weekday (Script)

This function accepts two arguments: 1) The date that you want to adjust,and 2)
The number of days you want to adjust the date by. The function is useful when
the user needs a date adjusted, but the date must be a weekday. This function
does not take into account Holidays.
Function FindWeekDay (tempdate As String, daysadjust As Integer) As String
Dim wd As Integer ' Weekday
Dim date1 As New NotesDateTime (tempdate)
date1.Adjustday(daysadjust) ' Adjust the 'date by the number of days
specified (Second 'argument).
wd = Weekday(date1.lslocaltime) ' Number for 'the day of the week.

While wd = 1 Or wd = 7 ' If the day is Sat '(7) or Sun (1)
date1.Adjustday(1) 'then increment the 'date the next Monday.
wd = Weekday(date1.lslocaltime) ' Reset 'the weekday variable

Wend
'If wd is not 1 or 7 the adjusted date is returned

FindWeekDay = date1.lslocaltime

End Function
This was first published in November 2000

Dig deeper on Lotus Notes Domino User Settings

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchDataCenter

SearchExchange

SearchContentManagement

Close