Mar 28, 2012

How to get the current month and day of the year ?


The below job gives the current month of the year

static void mthOfYrExample(Args _arg)
{
    int i;
    ;
    i = mthOfYr(today());
    info( "The number of the month in today's date is " + int2Str(i));

}

The below job gives the current day of the year


static void dayOfYrExample(Args _arg)
{
    date d = today();
    int i;
    ;
    i = dayOfYr(d);
    info( "Today's day of the year is " + int2Str(i));
 
}

     Just try this job
----------------------

static void dateExample(Args _arg)
{
    date d = today();
    str s;
    ;
    info(strfmt("%1,%2,%3",dayOfmth(d),mthofyr(d),year(d)));

}




No comments: