You can't directly.
You need some other indicator.
You could try using a nullable TimeSpan:
TimeSpan? entry=AdjustTime(int row, string colName);
private TimeSpan? AdjustTime(int row, string colName)
{
string s1 = dataGridView1.Rows[row].Cells[colName].Value.ToString();
return ((!string.IsNullOrEmpty(s1)) ? TimeSpan.Parse(s1 = (s1 == "24:00:00") ? "23:59:59" : s1) : null);
}
Or you could use another
impossible value for the default:
TimeSpan entry=AdjustTime(int row, string colName);
private TimeSpan AdjustTime(int row, string colName)
{
string s1 = dataGridView1.Rows[row].Cells[colName].Value.ToString();
return ((!string.IsNullOrEmpty(s1)) ? TimeSpan.Parse(s1 = (s1 == "24:00:00") ? "23:59:59" : s1) : TimeSpan.MinValue);
}