Json Format for a TimeSpan that can be bound using Microsoft.Extensions.Configuration

Timespan format in .net core is D.HH:mm:nn (so “1.02:03:04” is 1 day, 2 hours, 3 mins, 4 seconds).

javascript wont be able to read that (we use a custom JsonConverter for timespan objects for that reason), but .Net can.

{"timespan":"1.02:03:04"}

Leave a Comment