.Net Convert a JSON date to System.DateTime

Here’s a quick way of converting a JSON (Epoch) format datetime into something .Net can use:

using System;

using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace JsonDateTimeConverter
{
    class Program
    {
        static void Main(string[] args)
        {
            const string json = "{\"Date\" : \"\\/Date(-62135596800000-0000)\\/\"}";

            var result = JsonConvert.DeserializeObject<ConvertedDate>(json,
            new IsoDateTimeConverter { DateTimeFormat = "dd/mm/yyyy:hh:mm:ss" });

            Console.WriteLine(result.Date);
            Console.ReadKey();
        }
    }
    class ConvertedDate
    {
        public DateTime Date { get; set; }
    }
}