using System;
using Newtonsoft.Json;
public class Program {
public static void Main() {
var t = new Thing { Id = Guid.NewGuid(), CollectionTime = TimeSpan.FromSeconds(5) };
Console.WriteLine(JsonConvert.SerializeObject(t));
}
public class Thing {
public Guid Id { get; set; }
public TimeSpan CollectionTime { get; set; }