Datatable Date Format

Hi guys, I have an excel table with existing data with date format as ‘13-Sep-2018’, when I extract the data out to another datatable, the date format changes to ‘08/19/2018 00:00:00’ (from what I see when I export the datatable into excel). Is there any way on how I can keep the existing format of ‘13-Sep-2018’?

Hi @Edmundz,

You can convert it using

DateTime.Now.ToString(“dd-MMM-yyyy”, System.Globalization.CultureInfo.InvariantCulture)


1 Like

Thanks @PrankurJoshi ! Works nicely.

1 Like