How do I add a time interval to a DateTime?

To add a number of hours, minutes or seconds to a DateTime data value, set up a data item with type ‘Timespan‘. Using the function MakeTimeSpan() use the product of this function (its return value) to generate a time difference (positive or negative). Once you have the difference value, use a Calculation stage to add the difference value to your DateTime data item.

For example, to calculate the time two minutes prior to any supplied date/time value (using a variable called “myDateTime”), use this notation in a Calculation stage:

[myDateTime] – (MakeTimeSpan(0, 0, 2, 0))

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s