Hi
I’m trying to covert value into date format but getting an error can anyone help me on this?
Make the strSetDate as string variable. Expression looks correct
use below expression
DateTime.ParseExact("02/02/2025,“dd/MM/yyyy”,System.Globalization.CultureInfo.InvariantCulture).ToString(“MM/dd/yyyy”) and output variable type should be string
If you want to convert the date from string to datetime format use this:
setDate(DateTime) = DateTime.ParseExact(“02/02/2025”, “MM/dd/yyyy”, System.Globalization.CultureInfo.InvariantCulture)
and output will be in datetime
Hi @Akshaya89
Please use the below syntax, to resolve the error.
strSetDate = DateTime.ParseExact("02/02/2025","MM/dd/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString()
Hope it helps!!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.