Powerbuilder Date Math

How to subtract 30 days from a date in PowerBuilder?

I have the following code that returns today's date in a parameter, but I need today - 30 days:

dw_1.setitem (1, "begin_datetime", datetime (today (), Now ()))

+1


source to share


1 answer


you are probably looking for a function RelativeDate

. Unfortunately, it is required as a parameter Date

, not DateTime

, but we can work around this:



dw_1.setItem(1, "begin_datetime", DateTime( RelativeDate( today(), -30), Now() )

      

+7


source







All Articles