Problems converting List of Strings to DateTime

Hi guys,

I am having trouble converting a List of Dates (as Strings) into DateTime format.

You can see the screenshot I included. I hope it makes sense. The error given is:

.Error ERROR Validation Error Compiler error(s) encountered processing expression “DateTIme.ParseExact(item,“dd.mm.yyyy”,nothing)”.
Option Strict On disallows implicit conversions from ‘Object’ to ‘String’. Main.xaml

Thank you!

1 Like

Hey major_danger233.

You gotta use the expression Datetime.ParseExact(item, “dd.MM.yyyy”,system.Globalization.CultureInfo.InvariantCulture) and make sure you set the TypeArgument in the For Each property to String.

I’ve attached a xaml file for you :slight_smile:

Kind regards, Anders

Main.xaml (5.0 KB)

1 Like

Thanks AndersJesen!

I did not know that I had to set the TypeArgument in the For Each property to String. Thanks a lot!

By the way, what does “system.Globalization.CultureInfo.InvariantCulture” mean?

Thanks a lot! I highly appreciate the wonderful help.

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