How to convert the “[2/13/20 22:35:42:846 GMT+05:30]” into datetime variable
Used Datetime.ParseExact(strTime,“MM/dd/yy hh:mm:ss:SSS”,System.Globalization.CultureInfo.InvariantCulture) but giving an exception
String is not a valid Datetime
Hi,
The format mentioned is the date time I m getting from the server and I m capturing it in a string variable ,now I want to convert the time into minutes and compare it with 30 minutes
@supu123 Can you do this Check how the below Value appears in a Message Box :
“[2/13/20 22:35:42:846 GMT+05:30]”.replace(“[”,“”).replace(“]”,“”).Substring(0,16)
@supu123 Ok then, you can Assign that value to another String and use it like this :
Datetime.ParseExact(anotherString,“M/d/yy HH:mm:ss:”,System.Globalization.CultureInfo.InvariantCulture)