Adding Number to Date

Date Days = 10/10/2010;

int a = 5;

now i want to print “a = 5 + Days = 10/10/2010” AS

15/10/2010 i.e a = 5 so want to increase Days

How to achieve this

int day = dayofmth(days);

int month = mthofyr( days);

int yr = year(days);

day= day+a;

mkdate(day,month,year);

also please note: at any point if date is say:31/12/2010

Then we have to conside year.

so for that

use dateMthFwd mnth method in global class and add the above code accordingly if required.

i hope it will help

Regards

Shon

static void Job1(Args _args)
{
date dt;
date dt1;
int a=5;
;
dt= mkdate(20,10,2010);
dt1=dt+a;
print dt1;
pause;

}

i hope this may help u…

Hi Bobby,

try this it may help you…

static void Job4(Args _args)
{
TransDate d = mkdate(10,10,2010);
;

d = mkDate(dayofmth(d) + 5,mthofyr(d),year(d));
info(strfmt("%1",d));

}

Naresh Kolli

simply add it to the date.

static void addDate(Args _args)

{

Date addDate = systemdateget();

;

print addDate + 5;

pause;

}