Tuesday 29 March 2011

How can I extract the hour, minute and seconds from AX2009 time?

static void time(Args _args)
{
TimeIn _TimeIn;
int hourInt, minuteInt , SecondInt;
str s;
;

_TimeIn = str2time('5:45');


s = time2str(_TimeIn,0,0);
info(strfmt("%1",s));

hourInt= str2int(substr(s,0,2));
info(strfmt("%1" ,hourInt));
minuteInt= str2int(substr(s,4,2));
info(strfmt("%1" ,minuteInt));
SecondInt= str2int(substr(s,7,2));
info(strfmt("%1" ,SecondInt));

}

No comments:

Post a Comment