imprting excel to axapta problem with time field..

hi all,

i have problem with importing excel to axapta through class
iam getting all the fields exact data but problem with time fields.
i tried to convert using sring functoin…
still getting “0000” place of time field in table…
so could any one help me out of this…

waiting for reply… it


Hi Aditya,

the error may be of two reasons:

the value you entered in excel may be wrong value.

the field data type may be different.

check first that,If all is well then

Use the following code to insert into table from excel

timeStr = cells.item(i,1).value(); for example “09:45”,“10:50” etc;

time = str2Time(timeStr);

it will be converted as 09:45:00 am and will be inserted to table filed.

it worked for me.

Thanks and Regards,

Britto John Baskar.A

Hi Aditya,

Did u get the solution for this.??


As Baskar given till Converstion of Second, so once again you have to add one more convertion from Seconds into Time


time2str(time, Timeseparator::Colon, TimeFormat::Hour24);


This is the right Solution , Try this and implement wherever its required