December 13, 2012

How to Get a Month Before And a Month After From Specific Date

For Example we have a date "December 12th 2012".
To get a mont after this date, we can use function "nextMth(date _date)". 
To get a mont before this date, we can use function "prevMth(date _date)".
This is the complete code :

Static Void PrevNextMth_test()
{
        date      testDate = str2date("12/12/2012", 123);
        ;
        info(strfmt("This Date : %1, Next Month : %2", testDate, nextMth(testDate)));
        info(strfmt("This Date : %1, Last Month : %2", testDate, prevMth(testDate)));
}

result from above job is like this :

 

0 comments:

Post a Comment