I have a SQL output that comes with different fields. A couple of those fields are dates and I want to convert them to timestamp. Here is how the output of the dates look as it comes from the database:
4/6/2016 9:00:00 PM
And when converted to JSON it looks like this:
opening_date":"4/6/2016 9:00:00 PM"
I tried the following to convert the SQL request output
meeting_start_date = DateTime.ParseExact((string)((object[])((ArrayList)results)[i])[3].ToString(), "M/d/yyyy h:mm:ss tt", CultureInfo.InvariantCulture)
as per what I found in here, but I get the following error
Cannot implicitly convert type 'System.DateTime' to 'string'
is there something wrong with how I am using the function, or is there a better way to make the conversion from the SQL output to timestamp so it can be added to the json output.