Convert Date format while writing in Excel or Data Table

I have a report generated with this Date format:

When I write this data in another excel/data table, I want the date format like this:
Any suggestions will be appreciated. Thanks

@Rachita_Chauhan - You can try DateimeParseExact…

DateTime.ParseExact(row("InvoiceDate").ToString.Trim,"yyyy-MM-dd HH:mm:ss",System.Globalization.CultureInfo.InvariantCulture).ToString(“M/d/yyyy”)


1 Like

So, I have one more question, if I need to check that the Date is in yyyy-MM-dd format, how will I do that? Thanks…

@Rachita_Chauhan - I guess you are looking for this…


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.