If you are going to use the TimeSpan/DayTime string for the SecurityValidatio class’s methods, use the code below to test locally if the string format can be parsed correctly by Dotcom-Monitor.

private static string[] TimeSpanFormats = new string[] { "c", "g", "G", "d", "d\\.hh" };
private static string[] DateTimeFormats = new string[] { "d", "D", "f", "F", "g", "G", "yy/MM/dd", "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss" };
private TimeSpan parseTimeSpan(string value)
{
TimeSpan result = TimeSpan.Zero;
bool res = TimeSpan.TryParse(value, out result);
if (!res)
res = TimeSpan.TryParseExact(value, TimeSpanFormats, null, out result);

return result;
}
private DateTime parseDateTime(string value)
{
DateTime date = DateTime.MinValue;
bool res = DateTime.TryParse(value, out date);
if (!res)
{
DateTime.TryParseExact(value, DateTimeFormats, null, System.Globalization.DateTimeStyles.None, out date);
}
return date;
}