Double Date Conversion

HI, am reading data from excel to datatable, but the date will show as below.

  1. Tried using the below method to convert the format, but it become as string and written back to excel it become not filterable as data but as string. Is a simple to convert the date format and remain as date when written back to excel?

Convert.ToDateTime(Cdbl(item(“Valuation Date”))).ToString(“dd/MM/yyyy”)

Date
44652
44653

Hi,

Can you try FromOADate method as the following?

DateTime.FromOADate(Cdbl(item("Valuation Date"))).ToString("dd/MM/yyyy")

Regards,

1 Like