TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Example of JsonSerializerSettings
Kailash Chandra Behera
Nov 04
2015
Code
27.8
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
public
class
Log
{
public
string
Details
{
get
;
set
;
}
public
DateTime LogDate
{
get
;
set
;
}
}
Log log =
new
Log
{
LogDate =
new
DateTime.Now,
Details =
"Application started."
};
JsonSerializerSettings microsoftDateFormatSettings =
new
JsonSerializerSettings
{
DateFormatHandling = DateFormatHandling.MicrosoftDateFormat
};
string
microsoftJson = JsonConvert.SerializeObject(log, microsoftDateFormatSettings);
Result:
// {"Details":"Application started.","LogDate":"\/Date(1234656000000)\/"}
JsonSerializerSettings
Json