*DateTime intrinsic to add minutes/seconds/etc

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
adale
Posts: 210
Joined: Wed Apr 08, 2020 9:18 pm
Location: Poplarville, MS

*DateTime intrinsic to add minutes/seconds/etc

Post 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
Arlyn Dale
Servias LLC
srini87
Posts: 6
Joined: Fri Oct 09, 2020 4:21 pm

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

Post by srini87 »

Post Reply