Page 1 of 1

*DateTime intrinsic to add minutes/seconds/etc

Posted: Thu Oct 19, 2023 12:35 am
by adale
I am working with a field defined as *DATETIME (24) in a VL web application.
I want to take another *datetime field value, or #DATETIMEX.Now value, and add 'x' number of minutes or seconds to get the new DateTime value.

Is there an intrinsic for this?

I currently have this working, but looking for something cleaner or simpler if possible:
DEFINE Field(#wk_number) Type(*Dec) Length(14) Decimals(0)
DEFINE Field(#wk_datetime) Type(*Datetime) Length(24)

* add 5 minutes
#wk_number := #DATETIMEX.Now.AsNumber( CCYYMMDDHHMMSS ) + 500.00
#wk_datetime := #wk_number.AsDateTime( CCYYMMDDHHMMSS )
#txString2 := #wk_datetime.AsDisplayString

Re: *DateTime intrinsic to add minutes/seconds/etc

Posted: Fri Oct 20, 2023 10:21 pm
by srini87