How To Read Data from Excel Column "dd.MM.yyyy HH:mm:ss" and Convert it to Date Format?

Dears,

I have a list of Data in Excel Column where the values are not recognized as dates, I want to read each value from the whole column and Convert it to Date format , than write it in another column with correct Date Syntax : “dd.MM.yyyy HH:mm:ss”.
Knowing that I have used the following Variable and didn’t help : DateTime.ParseExact(Time1,“dd.MM.yyyy HH:mm:ss”,System.Globalization.CultureInfo.InvariantCulture).
Thanks in Advanceimage

You could use an assign activity with value like below and store it to a variable of type System.DateTime

DateTime.ParseExact("15.05.2019 02:55:06", "dd.MM.yyyy HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture)

If this is not working, could you please share the error?

@hsendel,

Can you please check this xaml file, this could help for your solution.

DateTime.ParseExact(dt.ToString(),“dd.MM.yyyy HH:mm:ss”,Globalization.CultureInfo.InvariantCulture).ToString(“dd/MM/yyyy HH:mm:ss”)

Dates.xaml (5.1 KB)

Thanks,
Arunachalam.

1 Like

Hi @hsendel

Buddy you were almost right, here is the small correction that can be made to resolve this

DateTime.ParseExact(Time1,“dd.MM.yyyy HH:mm:ss”,System.Globalization.CultureInfo.InvariantCulture)

Simple buddy remove the slash and place with dots

Cheers

Thanks Team,

I tried to build the same based on what has been shared by the 3 feedbacks, almost finished but still not able to fecth the exact value from created database.
Note : Please find in attachement related files. ThxDates.xaml (9.0 KB)
Example.xlsx (10.5 KB)

@hsendel,

That’s cool. I have checked your xaml file and updated. Can you please this file DateFormat.zip (2.0 KB)

Thanks,
Arunachalam.

1 Like

Great!! Arunachalam…;It works as desired. Thanks a lot Team :slight_smile:

@hsendel,

you are welcome :grinning:. Can you please make a solution so that our folks can understand the info of this thread.

Thanks,
Arunachalam.

Done :slight_smile:

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