Convert Number String to Date

Hi,

I am trying to convert 5012019 to a Date 05/01/2019. i read the date from excel sheet as a string which is 5012019 but needs to convert as a date.

Please let me know how we can achieve this. tried all possibilities but could not get it

Thank you
Veerendra

@veerendrakumar

Convert.ToDateTime(yourStringDate)

1 Like

Hi @veerendrakumar,

Datetime.parseexact(“5012019”,“Mddyyyy”,system.globalization.cultureinfo.invariantculture).tostring(“MM/dd/yyyy”)

Hi @lakshman

Got this below Error

Hi @anil5

Got this below error

@veerendrakumar

Could you please print the Excel value and show me once. Need to see the format how it is printing.