I have a sample date
DateTime startDate = DateTime.Parse("2011-01-01 00:00:00");
DateTime endDate = DateTime.Parse("2011-01-03 01:01:03");
How can I get it to Elapsed time of 49:01:03? I can’t get any string format including days.
Currently I want to use that on DataGridView’s Columns.
Below is the sample code of it:
private void dataGridView1_ColumnAdded(object sender, DataGridViewColumnEventArgs e)
{
e.Column.CellTemplate.Style.FormatProvider = new DayToHour();
//e.Column.CellTemplate.Style.Format = "";
}
But I can’t get it work :(.
Note: I don’t have any problem on subtracting the date and time. I’m asking about the format.
Closed: Just used wrapper class inheriting from IFormatProvider.
I think there might no such format available so you will have to get the value on these lines
Also have a look at this Custom Format provider