Get a date and time

Get a date and time

There are functions which you can use in your rules to get a particular date and time.

What do you want to do?

Get the current date and time

Get a date and time by joining together a separate date and time

Get a date and time from a text string

Get a date and time by adding or subtracting a specified number of hours to another date and time

Get a date and time by adding or subtracting a specified number of minutes to another date and time

Get a date and time by adding or subtracting a specified number of seconds to another date and time

Get the current date and time

To insert the system date and time into a rule, you use the Current Date Time function. For example, the following comparison:

the date and time of the investigation = CurrentDateTime()

will infer the date and time of the investigation to be 2007-11-12 15:37:00 if the rule is run on 2007-11-12 at 15:37:00.

NOTE: The Current Date Time function returns the system date/time at the start of the session.

Get a date and time by joining together a separate date and time

To set a date and time from a separate date and a separate time, you use the Concatenate Date Time function. For example:

the latest submission time = ConcatenateDateTime(the submission date, the submission closing time)

will infer the latest submission time to be 2010-01-15 17:00:00 if the submission date is 2010-01-15 and the submission closing time is 17:00:00.

Get a date and time from a text string

To set the value of a date and time variable from a text string, you use the DateTime function. For example:

the latest submission date and time= DateTime(the submission date and time specified on the application form)

will infer the latest submission date and time to be 2012-12-31 18:00:00 if the submission date and time specified on the application form is a text variable with the value of 2012-12-31 18:00:00.

Get a date and time by adding or subtracting a specified number of hours to another date and time

To add or subtract a specified number of hours to an input date and time to get a new date and time, you use the Add Hours function. For example:

the start datetime for the B grade runners = the time 2 hours before the start datetime for the A grade runners

will infer the start datetime for the B grade runners to be 2011-02-03 08:00:00 if the start datetime for the A grade runners is 2011-02-03 10:00:00.

Get a date and time by adding or subtracting a specified number of minutes to another date and time

To add or subtract a specified number of minutes to an input date and time to get a new date and time, you use the Add Minutes function. For example:

the datetime that the parking meter expires = the time 60 minutes after the datetime that the parking fee was paid

will infer the datetime that the parking meter expires to be 2012-10-10 12:04:17 if the datetime that the parking fee was paid is 2012-10-10 11:04:17.

Get a date and time by adding or subtracting a specified number of seconds to another date and time

To add or subtract a specified number of seconds to an input date and time to get a new date and time, you use the Add Seconds function. For example:

the completion datetime = AddSeconds(the start datetime, 30)

will infer the completion datetime to be 2009-01-01 16:30:00 if the start time is 2009-01-01 16:29:30.

 

See also: