-Reorganized examples

This commit is contained in:
James Newton-King
2013-01-25 00:14:14 +13:00
parent 7899af09c9
commit 253a0dae8e
57 changed files with 0 additions and 0 deletions
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Newtonsoft.Json.Tests.Documentation.Examples
{
public class SerializeDateFormatHandling
{
public void Example()
{
DateTime mayanEndOfTheWorld = new DateTime(2012, 12, 21);
string jsonIsoDate = JsonConvert.SerializeObject(mayanEndOfTheWorld);
Console.WriteLine(jsonIsoDate);
// "2012-12-21T00:00:00"
string jsonMsDate = JsonConvert.SerializeObject(mayanEndOfTheWorld, new JsonSerializerSettings
{
DateFormatHandling = DateFormatHandling.MicrosoftDateFormat
});
Console.WriteLine(jsonMsDate);
// "\/Date(1356044400000+0100)\/"
}
}
}