simplify jsondeserializer
This commit is contained in:
@@ -44,16 +44,6 @@ namespace UptimeSharp
|
||||
}
|
||||
return uri;
|
||||
};
|
||||
|
||||
// create DateTime from UNIX timestamp input
|
||||
JsConfig<DateTime?>.DeSerializeFn = value =>
|
||||
{
|
||||
if (value == "0")
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return new DateTime(1970, 1, 1, 0, 0, 0, 0).AddSeconds(Convert.ToDouble(value)).ToLocalTime();
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user