Date converstion

Hi Team,
I’m trying to convert a date value into “dd-MM-yyyy” format using Convert.ToDateTime(InvoiceDate).ToString(“dd-MM-yyyy”) and store it in excel. I’m able to convert the data successfully. However for few dates are stored as normal number. PFA. Highlighted invoice number and respective date in ACME and my output sheet.InvoiceOpimage

Request you to please check and advice.

Thanks
Nav

I guess this is a problem with excel formatting. If you change the format of those cells to date, you would have it in the format you entered.

Wondering if there was a problem with the date conversion for these specific dates. Are you writing it into excel sheet from data table? Using write range?

Hi Kaderms

Thanks for ur response. Yes, if I change the cell format, it displays the correct values. I’m using append range activity as I have to enter date value for each transaction. Please note: I’m using ReFramework.

Kind regards
Nav

Cool! You can observe the date conversion behavior for all the transactions and analyse where it fails to write in the given format.

Before Append Range activity, use Output Data Table and Write Line activities to output the content being written into excel.