public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
var nullableDouble = reader.Value as Nullable<double>;
if (nullableDouble != null)
return _epoch.AddSeconds((long)(nullableDouble ?? 0));
else
{
var nullableLong = reader.Value as Nullable<long>;
if (nullableLong != null)
return _epoch.AddSeconds(nullableLong ?? 0);
}
return _epoch;
}