Datetime formats and JSON data in C#

vjhpwaeoyp

New Member
I'm having an issue with date/time formats in ASP.NET/C#. I have my SQL Server database set up with a PostDate field set to a type of "datetime". But it's saving the date in a strange format. I added a new row through a form and I got this as the date/time string:\[code\]2012-09-28 14:56:48.910\[/code\]When it gets parsed by JSON.NET it gets even stranger. I get:\[code\]2012-09-28T14:56:48.91\[/code\]The date and time are obviously correct, but how do I set things so that I can parse the date into a human-friendly way? There isn't really any code to post because the date is being added when the row is inserted. I'd like to format this as "Sept. 28, 2012 2:56 pm". How do I do that? Do I need to format the string before or after it's parsed as JSON?
 
Back
Top