yogesh kapil
24th May 2012, 13:36
How do I print 1 month less date from the current date.

rahul.kolhe22
25th May 2012, 09:29
Hi,

Use function utc.add to calculate the date of 1 month before.

function long utc.add (long i.utc, long year, long month, long day, long hour, long minute, long second, long o.utc)

Description:
This adds years, months, days, hours, minutes, seconds to the input utc value and makes corrections if necessary.

Return values
0 Success.
1 Best guess.
2 Failure.

Pass month variable as -1 to get date of 1 month before.

Hope it helps...

Kind Regards,
--Rahul

yogesh kapil
28th May 2012, 11:58
hi rahul,

thanks for your help. Actually i am aware about utc.add(). But failed to use this in my program.

i am getting date from one of the coloum called tdsls402.prdt in table tdsls402 for item line for item. In this function

utc.add (long i.utc, long year, long month, long day, long hour, long minute, long second, long o.utc)

where should i put my date. Or i need to bifurcate my date.

one more thing what is the use of o.uct().

Please help me.

ipineda
29th May 2012, 00:31
I have check the field tdsls402.prdt in my BaaN V,LN FP3 and FP7 installations and the field doesn´t exist (Maybe you created that field or it is the field tdsls401.prdt). If you use the funciton utc.add() it is important to be sure that the field you are working with is in UTC format, you can check that in the domain definition.

You should check the programmer guide for the sintax details, it is something like this:

function long utc.add (
long i.utc, |* Variable with your input date, in your case tdsls402.prdt.
long year, |* 0
long month, |* -1
long day, |* 0
long hour, |* 0
long minute,|* 0
long second,|* 0
long o.utc) |* Variable that contains the result of the operation, in your case your date - 1 month

Good luck.

yogesh kapil
1st June 2012, 13:45
Hi,

Thanks for your help. Its working very fine. Again thank you so much.

Thanks and Regards
Yogesh Kapil













I have check the field tdsls402.prdt in my BaaN V,LN FP3 and FP7 installations and the field doesn´t exist (Maybe you created that field or it is the field tdsls401.prdt). If you use the funciton utc.add() it is important to be sure that the field you are working with is in UTC format, you can check that in the domain definition.

You should check the programmer guide for the sintax details, it is something like this:

function long utc.add (
long i.utc, |* Variable with your input date, in your case tdsls402.prdt.
long year, |* 0
long month, |* -1
long day, |* 0
long hour, |* 0
long minute,|* 0
long second,|* 0
long o.utc) |* Variable that contains the result of the operation, in your case your date - 1 month

Good luck.