*add_minutes Function


dim newTime as T = *ADD_MINUTES(time as T, minutes as N)



A time value.


The number of minutes to add to the time value. Minutes can be a negative value.



Returns the time value incremented by minutes.


Add minutes to date or time.


The *add_minutes() function increments a time value by a specified number of minutes.


dim time as t
time = now()
? time
= 10/12/2017 08:54:05 89 am

dim minutes as n
minutes = round(rand()*100,0)
? minutes
= 99

? *add_minutes(time, minutes)
= 10/12/2017 10:33:05 89 am

Example: Ajax Callback in a UX

The example below is an Ajax Callback for a UX Component with 3 text boxes with a T (time) type. The callback calculates two reminders based on the time value in the 'ScheduledTime' control. The resulting reminder values are set in the 'Reminder1' and 'Reminder2' text controls in the UX.

function calculateReminders as c (e as p)
    ' Get the submitted time value:
    dim time as T = convert_type(e.dataSubmitted.ScheduledTime,"T")

    ' Compute the time for the 2 reminders: 15 and 30 minutes prior:
    dim reminder1 as T = *add_minutes(time,-30)
    dim reminder2 as T = *add_minutes(time,-15)

    ' Set the value for the reminder textboxes in the UX
    ' Note: Must convert the time value to a string with the format
    ' matching the time format used in the controls.
    e._set.reminder1.value = time("MM/dd/yyyy 0h:0m am",reminder1)
    e._set.reminder2.value = time("MM/dd/yyyy 0h:0m am",reminder2)

    ' Return optional JavaScript here:
    calculateReminders = ""
end function

See Also