Excel string to date

Hello Guys,

I have string in format yyyyDDmm for example 20240102 and i want to convert it to date time in excel. How can i do this?

for exmaple 20240102 - > 01.02.2024

I tried format cells activity but it gaves me #### instead of date time format

Hi @Ababt

You can try the below syntax:

DateTime.ParseExact("20240102","yyyyddMM",System.Globalization.CultureInfo.InvariantCulture).ToString("dd.MM.yyyy")

Hope it helps!!

Hi,

How about widen the column width using AutiFitRange activity?

Regards,

@Ababt

If you are using read range workbook enable preserve format.
If you are using excel process scope in Read Formatting try different options

assignDateString = "20240102"
assignFormattedDate = DateTime.ParseExact(assignDateString, "yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture).ToString("MM.dd.yyyy")

@Ababt -

‘####’ in excel comes when the column size is shrunk, expand the column to see the full date.

you can format through the code as per above posts are mentioned.