String : 2017-05-01T16:46:36.000Z
Need to fetch only the date from string i.e, 2017-05-01 and covert to 01-05-2017
thanks,
Chiranjeevi
String : 2017-05-01T16:46:36.000Z
Need to fetch only the date from string i.e, 2017-05-01 and covert to 01-05-2017
thanks,
Chiranjeevi
Use Regular expression to fetch date from given string.
System.Text.RegularExpressions.RegEx.Matches(“String”,“\d{4}-\d{2}-\d{2}”)
To convert the data use below expression.
DateTime.ParseExact(dateString, “yyyy-MM-dd”,
System.Globalization.CultureInfo.InvariantCulture).Tostring(“dd-MM-yyyy”)
Getting compile error
Compiler error(s) encountered processing expression “System.Text.RegularExpressions.RegEx.Matches(created_Date,”\d{4}-\d{2}-\d{2}“)”.
Value of type ‘System.Text.RegularExpressions.MatchCollection’ cannot be converted to ‘String’.
Hi
Check the below Xaml
Hope it helps.
date_time.zip (11.0 KB)
Got it… Thanks you all