Expand my Community achievements bar.

The next phase for Workfront Community ideas is coming soon. Learn all about it in our blog!

Covert Portfolio Entry Date to C# datetime with JToken

Avatar

Level 1
Hi, I have tried to pull my all portfolios with all details and parse data using Jtoken into my application Object. But somehow, I am unable to convert Entry Date of portfolio into C# datetime object. Example : Error : Run-time exception (line 34): String was not recognized as a valid DateTime. Stack Trace: [System.FormatException: String was not recognized as a valid DateTime.] at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) at System.Convert.ToDateTime(String value, IFormatProvider provider) at System.String.System.IConvertible.ToDateTime(IFormatProvider provider) at System.Convert.ToDateTime(Object value, IFormatProvider provider) at Newtonsoft.Json.Linq.JToken.op_Explicit(JToken value) at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType) at Newtonsoft.Json.Linq.JToken.ToObject[T]() at Program.Main() :line 34 Please let us know any effective solution to covert it. Nishank Modi
0 Replies