Manage Learn to apply best practices and optimize your operations.

## This function adjusts the specified time-date value by the number of years, months, days, hours, minutes, and/or seconds.

This function adjusts the specified time-date value by the number of years, months, days, hours, minutes, and/or seconds you specify. The amount of adjustment may be positive or negative. This function is the equivalent of @Adjust in formula language. I hope someone finds this function useful.

Function Adjust(pDateToAdjust As NotesDateTime, pYear As Integer, pMonth As Integer, pDay As Integer, pHour As Integer, pMinute As Integer, pSecond As Integer) As NotesDateTime

``` ' By Tony Murphy ' No Warranty Is Granted ' Use At Your Own Risk ' Purpose: ' This function adjusts the specified time-date value by the number of ' years, months, days, hours, minutes, and/or seconds you specify. ' The amount of adjustment may be positive or negative. ' Arguments: ' pDateToAdjust - Time-date. The time-date value you want to increment.
This should be a single value, not a range. ' pYear - Number. The number of years to increment by. ' pMonth - Number. The number of months to increment by. ' pDay - Number. The number of days to increment by. ' pHour - Number. The number of hours to increment by. ' pMinute - Number. The number of minutes to increment by. ' pSecond - Number. The number of seconds to increment by. ' Special Notes: ' None ' History: ' 06/08/01, Tony Murphy, Created. 'Example: ' Dim dateTime As New NotesDateTime( "" ) ' Call dateTime.SetNow ' Set dateTime = Adjust(dateTime, 0, 0, 3, 0, 0, 0) On Error Goto ErrorHandler Dim dateTime As NotesDateTime Set dateTime = pDateToAdjust Call dateTime.AdjustYear( pYear ) Call dateTime.AdjustMonth( pMonth ) Call dateTime.AdjustDay( pDay ) Call dateTime.AdjustHour( pHour ) Call dateTime.AdjustMinute( pMinute ) Call dateTime.AdjustSecond( pSecond ) Set Adjust = dateTime TheEnd: Exit Function ErrorHandler: Print "Adjust: " & Str\$(Err) & " at line " & Str\$(Erl) & ": " & Error\$ Resume TheEnd End Function
```

## SearchWindowsServer

• ### Try default values in PowerShell parameters for flexibility

When you lock down your code to work in specific conditions, your automation efforts can fall flat. Try these techniques to add ...

• ### Cut coding corners with return values in PowerShell functions

In certain instances, a return keyword is a good option to exit the current scope of a function and to reduce the bloat from a ...

• ### Stay in control with Azure AD Privileged Identity Management

Rampant use of elevated privileges can prove hazardous to enterprises. Rein in access and manage resource access with help from ...

## Search400

• ### Favorite iSeries cheat sheets

Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/Search400.com community. These cheat ...

• ### HTML cheat sheet

This is a really cool cheat sheet if you're looking to learn more about HTML. You'll find just about everything you every wanted ...

• ### Carol Woodbury: Security

Carol Woodbury

## SearchDataCenter

• ### New Intel Ice Lake processors boost performance, security

Intel launches third-generation Xeon Scalable processors that bolster security, accelerate common data center workloads by 46% on...

• ### IBM tools speed mainframe application modernization projects

IBM has released new versions of its application modernization tools designed to bring its Z series of mainframe applications in ...

• ### Nvidia vs. AMD: Compare GPU offerings

Chip vendors Nvidia and AMD each offer GPUs optimized for large data centers. Compare the two to decide which best suits your ...