Hi guys,
I tried to convert this string “08/11/2019” to a datetime to compare it to now.datetime with convert.todatetime(“string”) but that doesnt work (string to datetime conversion not allowed).
Some idea?
Hi guys,
I tried to convert this string “08/11/2019” to a datetime to compare it to now.datetime with convert.todatetime(“string”) but that doesnt work (string to datetime conversion not allowed).
Some idea?
Hi @Farid,
Why not convert datetime to string and compare two strings? It’s easier
If you know the format, you can use Datetime.ParseExact(“String”,“format”)
How can i compare datetime with this methods?
string1 > string 2
You also need to provide an IFormatProvider or Nothing.
Datetime.ParseExact(“String”,“format”,Globalization.CultureInfo.InvariantCulture)
OR
Datetime.ParseExact(“String”,“format”,Nothing)
yep, it was I did but the string is not recognized as a valide datetime '
“08/11/2019"
i have tried the below and it works fine
datetime.ParseExact(“08/11/2019”,“MM/dd/yyyy”,Nothing)
I assume iDate is being stored as a String Variable date = “08/11/2019”
if you use Nothing like my example, my output datatime is this - 08/11/2019 00:00:00 (datetime variable)
I really dont know why it isn’t working for me xD
In your imports , do you have System.Globalization
Also idate is variable type System.Datetime?
Can you post your XAML here? I’m guessing it has to do with your variable types. idate is a system.datetime variable correct?
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.