Page 1 of 1

Date calculations

Posted: 28 Jan 2020 14:19
by Wibbly
I'd like to add a number of hrs, h, to the current date/time to create a new variable I can use with dateformat to generate a new date/time in the future. Can't seem to get the syntax right.

Anyone know what the expression(s) should look like?

Re: Date calculations

Posted: 28 Jan 2020 18:58
by Desmanto
Use addHours();

Code: Select all

houradd = 3;
t = addHours(triggertime, houradd);
Or you can just use the 3 directly.

Code: Select all

t = addHours(triggertime, 3);
{t} now is 3 hours from the triggertime. You can use dateformat later to show in the format you want.

Re: Date calculations

Posted: 29 Jan 2020 11:18
by Wibbly
Great - there's always a function I've not yet found!